File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ const DEFAULT_WARMUPS = 50;
33
44/**
55 * Formats a duration in nanoseconds to a compact human-readable string.
6+ *
67 * @param {bigint } ns Duration in nanoseconds.
78 * @returns {string } Formatted time string.
89 */
@@ -21,6 +22,7 @@ const formatTime = (ns) => {
2122
2223/**
2324 * Measures synchronous or async function execution time.
25+ *
2426 * @param {Function } fn Function to measure.
2527 * @returns {Promise<bigint> } elapsed nanoseconds
2628 */
@@ -36,6 +38,7 @@ const measurePerformance = async (fn) => {
3638
3739/**
3840 * Computes basic & extended statistics.
41+ *
3942 * @param {bigint[] } samples Array of samples in nanoseconds.
4043 * @returns {object } Stats
4144 */
@@ -75,6 +78,7 @@ const computeStats = (samples) => {
7578
7679/**
7780 * Benchmark a function.
81+ *
7882 * @param {string } fnName Name of the function (for logging).
7983 * @param {Function } fn Function to benchmark.
8084 * @param {object } [opts] Options.
You can’t perform that action at this time.
0 commit comments