LANGUAGE » PYTHON » PACKAGE

Time

Usage

Import the module:

python
import time
MethodDescription
timeReturn the time in seconds since the epoch as a floating point number.
sleepSuspend execution of the calling thread for the given number of seconds.

Examples

Get the difference in time between two places of the code.

python
start_time = time.time()
## ...
seconds_elapsed = time.time() - start_time