Module time is my favorite module, usually use to test the speed of my code.
Example:
import time
# start time
start = time.time()
# run the code
for i in xrange(0, 100):
print i
# end time
end = time.time()
# print the cost time (seconds)
print end - start
No comments:
Post a Comment