Created
October 17, 2018 16:18
-
-
Save qpleple/a6f5cbff11503dd29c949fd7d1b54aee 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
# -*- 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