I want to have a timed loop that contains a callback function. The callback function should only be callable within the time period
function my_callback( )
....
end
setCallback("my_callback")
time_limit = os.time() + 20
while (os.time() < time_limit) do
-- I want my_callback to be callable in this loop for 20 seconds only
end
What is a proper way to get this effect