import { TimerSystem , TimerSystemImpl } from "./TimerSystem" ; /**
 * A timer system implementation using milliseconds as the time unit.
 */ export class MillisecondsTimerSystem extends TimerSystem { constructor ( ) { super ( new MillisecondsTimerSystemImpl ( ) ) ; } } class MillisecondsTimerSystemImpl extends TimerSystemImpl { return setTimer ( t , callback ) { let timeout = setTimeout ( callback , Math . max ( t - this . now ( ) , 0 ) ) ; return ( ) => { clearTimeout ( timeout ) ; } ; } /**
     * Return the current clock time.
     */ now ( ) { return Date . now ( ) ; } }