Created
February 17, 2017 12:49
-
-
Save strokirk/fd8a680e41f89bab82350838f5d2edc8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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