Motoko Timers API: can this code cause a stack overflow?

    func setTimerA() {
      ignore Timer.setTimer(#seconds(10), func(): async () {
        Debug.print("fired");
        await fn();
        setTimerA();
      });
    };
    setTimerA();

I want to set a new timer only after the fn call is completed.

1 Like

I don’t think so, the stack is reset on await. Are you observing one?

nice

I have 4 timers with 1 await inside each