1import time
2start = time.process_time()
3# your code here
4print(time.process_time() - start)
1import time
2
3# starting time
4start = time.time()
5
6# program body starts
7for i in range(10):
8 print(i)
9
10# sleeping for 1 sec to get 10 sec runtime
11time.sleep(1)
12
13# program body ends
14
15# end time
16end = time.time()
17
18# total time taken
19print(f"Runtime of the program is {end - start}")