SNIPPET
2 Upvotes

Measuring the Time Taken For Code to Execute

Python
General Python

from time import time

start_time = time()

#Replace with code to execute...

print('Elapsed Time: {:.3f} seconds'.format(time() - start_time))

By detro - Last Updated Oct. 30, 2021, 5:48 p.m.

COMMENTS
RELATED SNIPPETS
Python For Else Loop
Python
General Python

Loop

2
1
Search Snippets by Tag: