MCPcopy
hub / github.com/vitejs/vite / timeFrom

Function timeFrom

packages/vite/src/node/utils.ts:363–373  ·  packages/vite/src/node/utils.ts::timeFrom
(start: number, subtract = 0)

Source from the content-addressed store, hash-verified

361}
362
363export 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.

Callers 5

resolveIdMethod · 0.90
transformMethod · 0.90
loadAndTransformFunction · 0.90
timeMiddlewareFunction · 0.90
transformFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected