Use of sleep in python [closed]

1

I know I need to import sleep of time :

import time

or

from time import sleep 

And that applies like this:

time.sleep(s)

but I do not know how to include it in the rest of the code.

    
asked by pmf 06.01.2016 в 01:46
source

1 answer

5

The sleep function pauses the execution of the thread on which it is executed, during the indicated time. for example, if I want "world" to go out 5 seconds after "hello". I'm calling timer.sleep (5) .

import time

print "hola"
time.sleep(5)
print "mundo"
    
answered by 06.01.2016 / 16:13
source