(name: string)
| 36 | export const time = (global.__time || Date.now) as () => number; |
| 37 | |
| 38 | export function start(name: string): void { |
| 39 | let info = timers[name]; |
| 40 | |
| 41 | if (info) { |
| 42 | info.currentStart = time(); |
| 43 | info.runCount++; |
| 44 | } else { |
| 45 | info = { |
| 46 | totalTime: 0, |
| 47 | count: 0, |
| 48 | currentStart: time(), |
| 49 | runCount: 1, |
| 50 | }; |
| 51 | timers[name] = info; |
| 52 | profileNames.push(name); |
| 53 | } |
| 54 | } |
| 55 | |
| 56 | export function stop(name: string): TimerInfo { |
| 57 | const info = timers[name]; |
no test coverage detected