← Every block

Interval Timer

Fire on a repeating interval and count the ticks, with the moment each one happened. Runs in your browser.

Try one

5s

0not started

Need to chain this with something else? Open in bode →

About Interval

A period, a count, and a moment

Set how often, press Start, and it fires. Each tick increments Count and stamps At with the moment it happened.

The period takes the same forms every length does — 5s, 1m30s, 1h — or comes down a wire, so "every 1.5 hours" can be computed rather than typed.

It spends time that is not yours

Every other block answers when asked. This one re-asks, and so does everything below it: a chain under a one-second interval runs once a second for as long as the bode is open.

That is the point of the block and the reason the card says what it is about to do. The shortest period is one second, and a faster one is run at one second rather than refused.

A run is never saved

The period is a setting and is stored. The run is not: the count, the last tick and whether it is going at all live only in this session.

So a bode you share arrives stopped at zero, and a reload is a fresh start. Nobody should open a link and find something polling on their behalf.

Use the moment, not the arithmetic

Browser timers drift, and a background tab is throttled harder still — a one-second interval in a tab you have switched away from may fire once a minute.

At is therefore the honest value: it records when a tick happened rather than when it was due. Measuring elapsed time by multiplying the count by the period will tell you a story the clock does not agree with.

Common questions

What is the shortest interval?
One second. Anything faster is accepted and runs at one second, and the card says so rather than quietly going at a different speed than you asked for. The floor exists because a period multiplies: at 100ms a three-block chain is thirty evaluations a second, and the cost lands on whoever opens the bode rather than whoever set it.
Does it keep running if I close the tab?
No. It runs only while the bode is open in front of you, and it is never saved — share a bode containing one and it arrives stopped, at zero. Nobody should inherit a poll they did not start.
Is the timing exact?
It is a browser interval, so it drifts slightly and browsers slow timers down in background tabs. The At output records when each tick actually happened rather than when it was due, so anything measuring elapsed time should use that rather than multiplying the count by the period.
Why does nothing come out before the first tick?
Because nothing has happened yet. Both outputs are absent until the first tick fires, so a block wired below waits rather than running once on a count nobody produced. Pressing Start resets the count to zero; stopping leaves the last tick in place.
Is anything sent anywhere?
Not by this block. It counts in your browser. If you wire it to something that makes requests, that will repeat on the same period, which is worth knowing before you set it to one second.