Skip to content
Jean Dubois edited this page Oct 9, 2023 · 7 revisions

time module

The time module can be imported with the statement import time.

The time module is used to sleep for seconds or milliseconds, and to know current time, timezone and system’s epoch.

Functions

  • time.sleep(seconds): pauses the program for seconds and do nothing. Returns None.
  • time.sleep_milliseconds(milliseconds): pauses the program for milliseconds and do nothing. Returns None.
  • time.time(): returns the float value of the time in seconds since the Epoch (system-dependent, check your epoch with time.epoch()).
  • time.epoch(): returns the str value of the Epoch of your system.

Constants

  • time.timezone: the timezone (number of seconds to add to GMT)
Clone this wiki locally