Skip to content

Instantly share code, notes, and snippets.

@yanmhlv
Created August 13, 2013 11:17
Show Gist options
  • Save yanmhlv/6220164 to your computer and use it in GitHub Desktop.
Save yanmhlv/6220164 to your computer and use it in GitHub Desktop.
tornado.ioloop.PeriodicCallback
import tornado.ioloop
count = 0
def print_hello():
global count
print(count, "Hello")
count += 1
timer = tornado.ioloop.PeriodicCallback(print_hello, 300)
timer.start()
if __name__ == '__main__':
tornado.ioloop.IOLoop.instance().start()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment