Skip to content

Instantly share code, notes, and snippets.

@qpleple
Created October 17, 2018 16:18
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 qpleple/a6f5cbff11503dd29c949fd7d1b54aee to your computer and use it in GitHub Desktop.
Save qpleple/a6f5cbff11503dd29c949fd7d1b54aee to your computer and use it in GitHub Desktop.
# -*- encoding: utf-8
import time, os, cPickle
from termcolor import colored
def chrono(method):
def timed(*args, **kw):
start = time.time()
result = method(*args, **kw)
print colored(" {} done in {:.3f} sec".format(method.__name__, time.time() - start), "cyan")
return result
return timed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment