Skip to content

Instantly share code, notes, and snippets.

@strokirk
Created February 17, 2017 12:49
Show Gist options
  • Select an option

  • Save strokirk/fd8a680e41f89bab82350838f5d2edc8 to your computer and use it in GitHub Desktop.

Select an option

Save strokirk/fd8a680e41f89bab82350838f5d2edc8 to your computer and use it in GitHub Desktop.
class Ticker:
def __init__(self):
self.t = [time.time()]
def tick(self):
self.t.append(time.time())
i = len(self.t) - 1
tot = self.t[-1] - self.t[0]
last = self.t[-1] - self.t[-2]
print("%s: %.3f - %.5f" % (i, tot, last))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment