Skip to content

Instantly share code, notes, and snippets.

@sankalpjonn
Created October 29, 2018 11:24
Show Gist options
  • Save sankalpjonn/25ba9103f47b58b2440d8b189c96bc7a to your computer and use it in GitHub Desktop.
Save sankalpjonn/25ba9103f47b58b2440d8b189c96bc7a to your computer and use it in GitHub Desktop.
Periodic task using time.sleep
import time
def foo():
print time.ctime()
while True:
foo()
time.sleep(1)
#Mon Oct 29 16:54:07 2018
#Mon Oct 29 16:54:08 2018
#Mon Oct 29 16:54:09 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment