Skip to main content

setClockInterval()

setClockInterval(cb, ms): () => void

Works the same way as setInterval but will wait to fire until next clock second.

Parameters

cb

() => void

ms

number

Returns

Function

Returns

void

Example

const cleanup = setClockInterval(() => console.log('hi'), 250);
// will log hi every 250ms starting on next clock second