The simplest way to do it is to put:
import time
start_time = time.time()
at the start and
print "My program took", time.time() - start_time, "to run"
at the end.
More Related Contents:
- Python countdown clock with GUI [duplicate]
- What is the best way to repeatedly execute a function every x seconds? [closed]
- Time-Limited Input? [duplicate]
- threading.Timer – repeat function every ‘n’ seconds
- Executing periodic actions [duplicate]
- How do I get my program to sleep for 50 milliseconds?
- Cancellable threading.Timer in Python
- how to pass parameters of a function when using timeit.Timer()
- How to repeatedly execute a function every x seconds?
- Non-polling/Non-blocking Timer?
- Python loop to run for certain amount of seconds
- How can I fill out a Python string with spaces?
- Shooting a bullet in pygame in the direction of mouse
- Function not changing global variable
- Round to 5 (or other number) in Python
- How to send email via Django?
- TypeError: expected a character buffer object – while trying to save integer to textfile
- Find sets of disjoint sets from a list of tuples or sets in python
- type hinting within a class [duplicate]
- Vectorized lookup on a pandas dataframe
- Cannot use Requests-Module on AWS Lambda
- Unable to install Pygame using pip
- Get date from ISO week number in Python [duplicate]
- How to Upload a large File (≥3GB) to FastAPI backend?
- Python regex: matching a parenthesis within parenthesis
- How to add an attention mechanism in keras?
- sys.stdin.readline() and input(): which one is faster when reading lines of input, and why?
- Writing code translator from Python to C? [closed]
- Webdriver Screenshot
- Pandas data frame to dictionary of lists