'use strict'; /* * The only place server code reads time. Every other module takes a clock; tests inject FakeClock. * All times are integer ms since the epoch, UTC. */ class RealClock { now() { return Date.now(); } } class FakeClock { constructor(start) { this.t = start === undefined ? Date.UTC(2026, 0, 1) : start; } now() { return this.t; } set(t) { this.t = t; } advance(ms) { this.t += ms; return this.t; } } module.exports = { RealClock, FakeClock };