(start: number, subtract = 0)
| 361 | } |
| 362 | |
| 363 | export function timeFrom(start: number, subtract = 0): string { |
| 364 | const time: number | string = performance.now() - start - subtract |
| 365 | const timeString = (time.toFixed(2) + `ms`).padEnd(5, class="st">' ') |
| 366 | if (time < 10) { |
| 367 | return colors.green(timeString) |
| 368 | } else if (time < 50) { |
| 369 | return colors.yellow(timeString) |
| 370 | } else { |
| 371 | return colors.red(timeString) |
| 372 | } |
| 373 | } |
| 374 | |
| 375 | /** |
| 376 | * pretty url for logging. |
no outgoing calls
no test coverage detected