0

I want to make a stopwatch that countdown in real seconds, soo i build a super basic stopwatch but s you expect is this counting down within milliseconds. How can i import real time into this?

count = 100

while count > 0:
    print(count)
    count -= 1
Twonky
  • 796
  • 13
  • 31
LvdB
  • 23
  • 5

1 Answers1

0

In your loop, you need to tell your processor to wait (aka sleep) for a second. How this is achieved, depends on the programming language.

Edit

For Python, this will help:

import time
while True:
    print("This prints once a minute.")
    time.sleep(60) # Delay for 1 minute (60 seconds).

where fractions of a second as in sleep(0.05) are valid as well.

(taken from here and here)

Twonky
  • 796
  • 13
  • 31