INNER CODE UNIT · TypeScript
delay
gommzystudio/device-activity-tracker · src/signal-tracker.ts:234
const delay = Math.floor(Math.random() * 1000) + 1000;
await new Promise(resolve => setTimeout(resolve, delay));
}
}
/**
* Send a probe and wait for receipt or timeout before returning
* This ensures only ONE probe is in flight at a time (serialization)
*/
private async sendSerializedProbe(): Promise<void> {
return new Promise<void>(async (resolve) => {
// Store resolve function so receipt handler can signal completion
this.probeResolve = resolve;
// Record probe start time
this.pendingProbeStartTime = Date.now();
// Send the probe