lua-users home
lua-l archive

lalarm: multiple alarms?

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Is it possible to get several different, concurrent alarms running
using lalarm? So far all I can get is the most recent alarm
invocation to work, like this:
------------ begin lua code ---------------
function bing()
 print("bing")
 alarm(2)
end
function bong()
 print("bong")
 alarm(5)
end
print("starting now")
alarm(2, bing)
alarm(5, bong)
while true do
end
------------- end lua code ---------------------
When I run this only the 5-second timer runs, printing out "bong"
every 5 seconds.
Is there a way to run multiple alarms each with different timeouts?
Thanks,
Bill

AltStyle によって変換されたページ (->オリジナル) /