diff --git a/packages/bench/src/timed.ts b/packages/bench/src/timed.ts index 430f1d0b96..b07827d909 100644 --- a/packages/bench/src/timed.ts +++ b/packages/bench/src/timed.ts @@ -17,7 +17,7 @@ export const timed = (fn: () => T, prefix = "") => { /** * Similar to {@link timed}, but produces no output and instead returns - * tuple of `fn`'s result and the time measurement. + * tuple of `fn`'s result and the time measurement (in milliseconds). * * @param fn - function to time */ @@ -27,8 +27,8 @@ export const timedResult = (fn: () => T): TimingResult => { const t1 = now(); return [ res, - typeof BigInt !== "undefined" - ? Number(t1 - t0) * 1e-6 - : t1 - t0 + (typeof BigInt !== "undefined" + ? Number(t1 - t0) + : t1 - t0) * 1e-6, ]; };