(task: Clock.Task, duration: Duration.Duration)
| 20 | /** @internal */ |
| 21 | export const globalClockScheduler: Clock.ClockScheduler = { |
| 22 | unsafeSchedule(task: Clock.Task, duration: Duration.Duration): Clock.CancelToken { |
| 23 | const millis = Duration.toMillis(duration) |
| 24 | // If the duration is greater than the value allowable by the JS timer |
| 25 | // functions, treat the value as an infinite duration |
| 26 | if (millis > MAX_TIMER_MILLIS) { |
| 27 | return constFalse |
| 28 | } |
| 29 | let completed = false |
| 30 | const handle = setTimeout(() => { |
| 31 | completed = true |
| 32 | task() |
| 33 | }, millis) |
| 34 | return () => { |
| 35 | clearTimeout(handle) |
| 36 | return !completed |
| 37 | } |
| 38 | } |
| 39 | } |
| 40 | |
| 41 | const performanceNowNanos = (function() { |
nothing calls this directly
no test coverage detected
searching dependent graphs…