4 תשובות
import time

def start_timer():
print("timer started. press enter to stop.")
start_time = time.time() # get the current time in seconds

input() # wait for user to press enter

end_time = time.time() # get the current time again when enter is pressed

elapsed_time = end_time - start_time # calculate elapsed time

print(f"timer stopped. elapsed time: {elapsed_time:.2f} seconds")

start_timer()
שואל השאלה:
יש דרך יותר פשוטה? ואם אפשר הסבר אשמח
אנונימי
את האמת שבדקתי עם chat gpt
הוא לגמרי יכול לעזור לך
שואל השאלה:
מזה?
אנונימי