Created
April 13, 2017 10:35
-
-
Save fanhaipeng0403/2911d26f8cb9c5cf72e5a0dcfda23565 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
def profile(func): | |
def wrapper(*args, **kwargs): | |
import time | |
start = time.time() | |
func(*args, **kwargs) | |
end = time.time() | |
print(end - start) | |
return wrapper |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment