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 @@ -371,9 +371,9 @@ function sampleModule(modulePath: string): Promise<BenchmarkSample> {
371
371
372
372
clock(7, benchmark.measure); // warm up
373
373
global.gc();
374
- process.nextTick(() => {
374
+ process.nextTick(async () => {
375
375
const memBaseline = process.memoryUsage().heapUsed;
376
- const clocked = clock(benchmark.count, benchmark.measure);
376
+ const clocked = await clock(benchmark.count, benchmark.measure);
377
377
process.send({
378
378
name: benchmark.name,
379
379
clocked: clocked / benchmark.count,
@@ -382,10 +382,10 @@ function sampleModule(modulePath: string): Promise<BenchmarkSample> {
382
382
});
383
383
384
384
// Clocks the time taken to execute a test per cycle (secs).
385
- function clock(count, fn) {
385
+ async function clock(count, fn) {
386
386
const start = process.hrtime.bigint();
387
387
for (let i = 0; i < count; ++i) {
388
- fn();
388
+ await fn();
389
389
}
390
390
return Number(process.hrtime.bigint() - start);
391
391
}
You can’t perform that action at this time.
0 commit comments