Sets an interval that fires at the given interval with respect to timestamp 0.
const start = Date.now(); // 5555// interval fires every secondsetAbsoluteInterval(()=>{ const now = Date.now(); console.log(`${now}: FIRED`);}, 1000);// ideal output:// 6000: FIRED// 7000: FIRED// 8000: FIRED// etc... Copy
const start = Date.now(); // 5555// interval fires every secondsetAbsoluteInterval(()=>{ const now = Date.now(); console.log(`${now}: FIRED`);}, 1000);// ideal output:// 6000: FIRED// 7000: FIRED// 8000: FIRED// etc...
The first time the interval fires, the delay can vary wildly. If you set it at timestamp ###999, it will want to fire after 1 millisecond. If you set it at timestamp ###001, it will want to fire after 999 milliseconds.
###999
1
###001
999
A callback that is fired on the interval.
The interval to fire the callback at.
An ID that tracks this interval.
Sets an interval that fires at the given interval with respect to timestamp 0.
The first time the interval fires, the delay can vary wildly. If you set it at timestamp
###999
, it will want to fire after1
millisecond. If you set it at timestamp###001
, it will want to fire after999
milliseconds.