refactor(build): time builds with performance.now

Monotonic clock, so a wall-clock adjustment mid-build cannot skew
the reported duration.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
pull/4634/merge
Divyansh Singh 4 days ago
parent 8af4a0f5ea
commit 412d4638c1

@ -27,7 +27,7 @@ export async function build(
onAfterConfigResolve?: (siteConfig: SiteConfig) => Awaitable<void>
} = {}
) {
const start = Date.now()
const start = performance.now()
process.env.NODE_ENV = 'production'
const siteConfig = await resolveConfig(root, 'build', 'production')
@ -181,7 +181,7 @@ export async function build(
clearCache()
siteConfig.logger.info(
`build complete in ${((Date.now() - start) / 1000).toFixed(2)}s.`
`build complete in ${((performance.now() - start) / 1000).toFixed(2)}s.`
)
}

Loading…
Cancel
Save