File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -369,9 +369,9 @@ function sampleModule(modulePath: string): Promise<BenchmarkSample> {
369
369
370
370
clock(7, benchmark.measure); // warm up
371
371
global.gc();
372
- process.nextTick(() => {
372
+ process.nextTick(async () => {
373
373
const memBaseline = process.memoryUsage().heapUsed;
374
- const clocked = clock(benchmark.count, benchmark.measure);
374
+ const clocked = await clock(benchmark.count, benchmark.measure);
375
375
process.send({
376
376
name: benchmark.name,
377
377
clocked: clocked / benchmark.count,
@@ -380,10 +380,10 @@ function sampleModule(modulePath: string): Promise<BenchmarkSample> {
380
380
});
381
381
382
382
// Clocks the time taken to execute a test per cycle (secs).
383
- function clock(count, fn) {
383
+ async function clock(count, fn) {
384
384
const start = process.hrtime.bigint();
385
385
for (let i = 0; i < count; ++i) {
386
- fn();
386
+ await fn();
387
387
}
388
388
return Number(process.hrtime.bigint() - start);
389
389
}
You can’t perform that action at this time.
0 commit comments