(type: string, desc?: string)
| 24 | } |
| 25 | |
| 26 | function createTimer(type: string, desc?: string) { |
| 27 | const start = performance.now() |
| 28 | return { |
| 29 | end(timings: Timings) { |
| 30 | let timingType = timings[type] |
| 31 | |
| 32 | if (!timingType) { |
| 33 | timingType = timings[type] = [] |
| 34 | } |
| 35 | timingType.push({ desc, time: performance.now() - start }) |
| 36 | }, |
| 37 | } |
| 38 | } |
| 39 | |
| 40 | export async function time<ReturnType>( |
| 41 | fn: Promise<ReturnType> | (() => ReturnType | Promise<ReturnType>), |
no outgoing calls
no test coverage detected