1import time
2def converter(hours, minutes, seconds):
3 return hours * 3600 + minutes * 60 + seconds
4time.sleep(converter(hrs, mins, secs))
5print("time's up")
1import time
2import sys
3time_left = int(input("How long would you like the timer to go (in seconds)? "))
4check_for_decimal = time_left % 1
5
6if check_for_decimal not 0:
7 print("Use a whole number pls")
8 sys.exit()
9
10if time_left < 1:
11 print("Please use a number greater than 0.")
12 sys.exit()
13
14while True:
15 time.sleep(1)
16 time_left -= 1
17 if time_left == 0:
18 print("Time's up!")
19 break
20
21# Since I'm such a good programmer (/s), I didn't test this at all :)
22# Let me know if there is an error and I will try to fix it.
1import time
2length = int(input('How many seconds: '))
3time.sleep(length)
4print('Time is up')
1const oldDate = Date.parse("4/10/2020, 12:00:00");
2
3const timeBetweenDates = (date1, date2) => {
4 const date = new Date(date1 - date2);
5 return {
6 years: date.getYear() - 70,
7 months: date.getMonth(),
8 days: date.getDay(),
9 hours: date.getHours(),
10 minutes: date.getMinutes(),
11 seconds: date.getSeconds(),
12 }
13}
14
15const pre = document.getElementById("display");
16setInterval(() => {
17 pre.textContent = JSON.stringify(timeBetweenDates(Date.now(), oldDate), 0, 2);
18}, 1000);
1# Python code to make timer
2from time import sleep
3
4delay = input("How long do you want to set the timer for? ")
5sleep(delay)
6print("Times Up!")