src/realtime-callbacks.js
function _scheduleRealCallback() {
    if (_realCallbackKey) {
        global.clearTimeout(_realCallbackKey);
    }

    const first = _callbackList[0];

    if (!first) {
        debuglog("_scheduleRealCallback: no more callbacks, not rescheduling");
        return;
    }

    const now = _now();
    const delayMs = Math.min(first.runAt - now, TIMER_CHECK_PERIOD_MS);

    debuglog("_scheduleRealCallback: now:", now, "delay:", delayMs);
    _realCallbackKey = global.setTimeout(_runCallbacks, delayMs);
}
function _scheduleRealCallback() {
    if (_realCallbackKey) {
        global.clearTimeout(_realCallbackKey);
    }

    const first = _callbackList[0];

    if (!first) {
        debuglog("_scheduleRealCallback: no more callbacks, not rescheduling");
        return;
    }

    const now = _now();
    const delayMs = Math.min(first.runAt - now, TIMER_CHECK_PERIOD_MS);

    debuglog("_scheduleRealCallback: now:", now, "delay:", delayMs);
    _realCallbackKey = global.setTimeout(_runCallbacks, delayMs);
}
function _scheduleRealCallback ( ) { if ( _realCallbackKey ) { global . clearTimeout ( _realCallbackKey ) ; } const first = _callbackList [ 0 ] ; if ( ! first ) { debuglog ( "_scheduleRealCallback: no more callbacks, not rescheduling" ) ; return ; } const now = _now ( ) ; const delayMs = Math . min ( first . runAt - now , TIMER_CHECK_PERIOD_MS ) ; debuglog ( "_scheduleRealCallback: now:" , now , "delay:" , delayMs ) ; _realCallbackKey = global . setTimeout ( _runCallbacks , delayMs ) ; }
use the real global.setTimeout to schedule a callback to _runCallbacks.
use the real global . setTimeout to schedule a callback to _runCallbacks .