I have found this post in which, the first answer tells how to get the execution time of a program.
I have tried to implement it in my code as
import time
start_time = time.time()
import nod16
print("--- %s seconds ---" % (time.time() - start_time))
where nodo 16 is a program also generated by me. As you can tell, there are another 15 programs between start_time
and print
.
Unfortunately, I get the following error once I run my code:
print("--- %s seconds ---" % (time.time() - start_time))
NameError: name 'time' is not defined
I know this happens because I have to import another program. Unfortunately, the original post doesn't explain how to do this importing code. Can someone help?