Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Timers

Standard timer globals are installed in every runtime:

const timeout = setTimeout(() => console.log("once"), 250);
const interval = setInterval(() => console.log("tick"), 1000);

clearTimeout(timeout);
clearInterval(interval);

The equivalent module API is:

import { timers } from "fumo:timers";

const id = timers.setTimeout(callback, 250);
timers.clear(id);

Timers execute on the same owner lane as events and are checked at the next script pump. They do not create threads and do not enter QuickJS from Present. Delays are clamped to ten minutes, repeating timers have a minimum 1 ms delay, and one pump processes at most 64 due callbacks per package.