13 lines
406 B
JavaScript
13 lines
406 B
JavaScript
/** Timing is log data, never part of an artifact or its witness. */
|
|||
|
|
export function measureBuild(phase, details, action) {
|
||
|
|
const started = performance.now();
|
||
|
|
try {
|
||
|
|
return action();
|
||
|
|
} finally {
|
||
|
|
if (process.env.QUIXOS_TRACE_PROFILE === "1")
|
||
|
|
console.error(
|
||
|
|
`[qx-build-profile] ${JSON.stringify({ phase, ms: Math.round(performance.now() - started), ...details })}`,
|
||
|
|
);
|
||
|
|
}
|
||
|
|
}
|