Using the mops Timer Tool library

Using the base timer will be easier, but your timers will not survive the upgrade.

If you use the timer tool then then they should survive the upgrade.

The readme has a bit of documentation…if you have any questions, feel free to ask them:

Generally, you need to instantiate the object(It should provide handy initialState and Init function…you’ll be handing it a stable variable for storage), and then you wire up various “actionTypes” to functions. When you set timers elsewhere in your code they’ll be handed to these functions along with the data you provided. Typical timers do not allow you to pass metadata to the timer, but the timer tool lets you do that.

There is a bit more over here: TimerTool - a robust timer layer for motoko

Please let me know where the documentation is insufficient.

It may be helpful to review the GitHub - icdevsorg/class-plus: Class Plus Helper for Motoko repo as well as the timerTool now implements that way of instantiating, preserving, and upgrading module data.