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 @@ -341,9 +341,9 @@ function sampleModule(modulePath) {
341
341
342
342
clock(7, module.measure); // warm up
343
343
global.gc();
344
- process.nextTick(() => {
344
+ process.nextTick(async () => {
345
345
const memBaseline = process.memoryUsage().heapUsed;
346
- const clocked = clock(module.count, module.measure);
346
+ const clocked = await clock(module.count, module.measure);
347
347
process.send({
348
348
name: module.name,
349
349
clocked: clocked / module.count,
@@ -352,10 +352,10 @@ function sampleModule(modulePath) {
352
352
});
353
353
354
354
// Clocks the time taken to execute a test per cycle (secs).
355
- function clock(count, fn) {
355
+ async function clock(count, fn) {
356
356
const start = process.hrtime.bigint();
357
357
for (let i = 0; i < count; ++i) {
358
- fn();
358
+ await fn();
359
359
}
360
360
return Number(process.hrtime.bigint() - start);
361
361
}
You can’t perform that action at this time.
0 commit comments