Skip to content

Instantly share code, notes, and snippets.

@dvillega
Forked from lucindo/Timer.py
Created August 25, 2017 16:48
Show Gist options
  • Save dvillega/205ac005386e154c1a05af07c825be3c to your computer and use it in GitHub Desktop.
Save dvillega/205ac005386e154c1a05af07c825be3c to your computer and use it in GitHub Desktop.
import time
# Simple Timer
class Timer:
def __init__(self):
self.reset()
def reset(self):
self._start = time.time()
def elapsed(self): # elapsed time in seconds (float)
return time.time() - self._start
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment