You need to use Timers.
var timer = Timer.new()
and call your
As the timer callback function or inside a timer callback function.
You can also add a timer to the scene itself but then the timer will only be called, when the scene loads.
I also recommend reading the full docs on the Timer class to tweak the settings there are plenty of customization options.