Timer API for motoko

I’m eager to get remove the heartbeat() method from my code. I’m wondering if the new Timer API is available for Motoko yet and if so, where can I find the docs and an example?

Yes, it is. You’ll find everything here:

You can then import it with

import Timer "mo:base/Timer";

Also possibly helpful:

1 Like

You probably need to pull down an 8.x release of motoko and put it in your dfx cache for 0.12.1. There is an env variable for vessel that you can use as well…but I’m not sure what it is.

1 Like