Created
April 6, 2014 19:30
-
-
Save e-chernigovskii/10010488 to your computer and use it in GitHub Desktop.
This file contains 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
__author__ = 'Evgeny Chernigovsky' | |
import time | |
def time_decorator(func): | |
def wrap(*args, **kwargs): | |
start_time = time.time() | |
func(*args, **kwargs) | |
end_time = time.time() | |
pattern = 'Function {0} was called with args:\n{1}\nand kwargs:\n{2}\nExecution time:\n{3}' | |
print(pattern.format(func.__name__, args, kwargs, end_time - start_time)) | |
return wrap |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment