use a metro. see study 3
basically set a time to elapse, and a callback function to do whatever action you need.
generally norns scripting needs to be considered in terms of functions. anything time-based has to be associated with a metronome waiting and then calling the function.
somewhat like DEL in teletype. it just queues an an action (function) for future execution.
here’s a quick example:
m = metro.alloc()
m.time = 1
m.count = 1
m.callback = function() print("hello from the future") end
m:start()
(we have a PR on the way to condense the syntax for all of this)
you can re-use m also. reassign the time, call start again, change the callback function. it’s all fine.
so
m.callback = function() print("do something else")
m:start()