Skip to content

Commit b25904c

Browse files
chore: improve bench tests utils jsdoc readability (anuraghazra#4501)
Co-authored-by: Alexandr <qwerty541zxc@gmail.com>
1 parent 5031e32 commit b25904c

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

tests/bench/utils.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff 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.

0 commit comments

Comments
 (0)