timer 5000, [do.some.stuff]
print "going to do some stuff in a bit"
button "Click me to exit", [Exit.ThisThing]
wait
[do.some.stuff]
print "Doing Some Stuff"
wait
[Exit.ThisThing]
end
A timer lets you execute a branch at a regular interval.
In this example the timer will fire ever 5 seconds and print some text to your browser window.
This is useful if you need to take a sensor measurement or do some other task periodically.