Bill Reason Bill Reason - 3 months ago 44
Python Question

Is there a way to time things in Python?

Is there a way to time the amount of time that happened between (for example) button a being pressed and button b being pressed in Python? If so, how?

Thanks for any help.

am2 am2

You dislike to search before ask, isnt't it? there is a module surprisingly called time

import time
start = time.time()
for i in range(10):
    print i
stop = time.time()
print 'elapsed time in seconds', stop - start