파이썬 python 타이머 간단 구현 Timer

반응형
  • 코드 작성
import time

print("Timer starting...")

start_time = time.time()

remaining = 10
while remaining > 0:
    print("{} seconds remaining".format(int(remaining)))
    time.sleep(1)
    remaining = 10 - (time.time() - start_time)

print("Time's up!")
반응형