Hello,
I have a Alarmclock, and I want to trigger different things after some time (turn coffe machine on, and 30min later turn it off), but I am unsure about how timers specificially work.
sendCommand(coffee, ON)
sendCommand(lichtwecker, 10)
timer1 = createTimer(now.plusMinutes(5), [|
sendCommand(lichtwecker, 40)
timer10 = null
])
timer2 = createTimer(now.plusMinutes(30), [|
sendCommand(coffee, OFF)
sendCommand(lichtwecker, OFF)
timer30 = null
])
Timer10 ist triggered 5 minutes after the coffee machine is turned on. Is timer30 initialized AFTER timer10 finnished (is timer10 blocking?) or is it initialized at the same time.
So:
coffee ON = 0
timer10 = +10min
timer30 = +30 or +35min?
thanks
Daniel
EDIT: to answer the question for anyone that comes looking, the timer are initialized at the same time.
So timer10 would be after 5 minutes in th above example (now.plusMinutes(5)), and timer30 would be after 30 minutes.