Skip to content

Instantly share code, notes, and snippets.

@devendranaga
Last active August 29, 2015 14:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save devendranaga/1921423764be616364fc to your computer and use it in GitHub Desktop.
Save devendranaga/1921423764be616364fc to your computer and use it in GitHub Desktop.
#!/usr/bin/python
# only has seconds resolution
class Profile:
def profile_start(self):
self.start = time.gmtime()
def profile_stop(self):
self.stop = time.gmtime()
def profile_display(self):
secs_elapsed = ((self.stop.tm_hour * 60 * 60) + (self.stop.tm_min * 60) + (self.stop.tm_sec)) - ((self.start.tm_hour * 60 * 60) + (self.start.tm_min * 60) + (self.start.tm_sec))
print "executed for " + str(secs_elapsed) + " seconds"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment