time.time function
import time
def doSomething(seconds):
time.sleep(seconds)
startTime = time.time()
doSomething(3)
endTime = time.time()
executionTime = endTime - startTime
print('%.8f sec' % executionTime)
import time
def doSomething(seconds):
time.sleep(seconds)
startTime = time.time()
doSomething(3)
endTime = time.time()
executionTime = endTime - startTime
print('%.8f sec' % executionTime)
Leave a Comment
Cancel reply