2

Here's what I tried (Python):

import time

def wait(seconds):
    start_time = time.time()
    while start_time + seconds <= time.time():
        pass

But this just quits instantly.

Paul R
  • 202,568
  • 34
  • 375
  • 539

1 Answers1

11

The following code will efficiently sleep for a specified amount of time

import time
time.sleep(1) # delays for 1 second
Paladine
  • 513
  • 3
  • 11