Answers for "python calculate run time of function"

12

python measure time

import time

start = time.time()
print("hello")
end = time.time()
print(end - start)
Posted by: Guest on March-24-2020
8

find time of run for python code

import time
start_time = time.time()
main()
print("--- %s seconds ---" % (time.time() - start_time))
Posted by: Guest on December-10-2020

Code answers related to "python calculate run time of function"

Python Answers by Framework

Browse Popular Code Answers by Language