Skip to content

Instantly share code, notes, and snippets.

@pilate pilate/whichway.py Secret
Created Apr 10, 2019

Embed
What would you like to do?
flush_timeout = 10
last_flush = timestamp()
...
if (last_flush + flush_timeout) < timestamp():
flush()
last_flush = timestamp()
# ---- OR -----
flush_timeout = 10
next_flush = timestamp() + flush_timeout
...
if next_flush < timestamp():
flush()
next_flush = timestamp() + flush_timeout
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.