151 of 151 menu

The sleep method of the time module

The sleep method of the time module stops the operation for the specified number of seconds. In the method parameter, we specify the time in seconds.

Syntax

import time time.sleep(time in seconds)

Example

Let's pause the execution of the exclamation mark output for 5 seconds:

import time time.sleep(5) print('!!!')

The result of the executed code after five seconds:

!!!

See also

  • method datetime of module datetime,
    which creates a date and time object
  • method strftime of module datetime,
    which creates a formatted string with date and time
English
AfrikaansAzərbaycanБългарскиবাংলাБеларускаяČeštinaDanskDeutschΕλληνικάEspañolEestiSuomiFrançaisहिन्दीMagyarՀայերենIndonesiaItaliano日本語ქართულიҚазақ한국어КыргызчаLietuviųLatviešuМакедонскиMelayuမြန်မာNederlandsNorskPolskiPortuguêsRomânăРусскийසිංහලSlovenčinaSlovenščinaShqipСрпскиSrpskiSvenskaKiswahiliТоҷикӣไทยTürkmenTürkçeЎзбекOʻzbekTiếng Việt
We use cookies for website operation, analytics, and personalization. Data processing is carried out in accordance with the Privacy Policy.
accept all customize decline