Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions benchmark/fs/bench-stat-promise.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';

const common = require('../common');
const fs = require('fs');
const fsPromises = require('fs/promises');

const bench = common.createBenchmark(main, {
n: [20e4],
Expand All @@ -10,11 +10,11 @@ const bench = common.createBenchmark(main, {

async function run(n, statType) {
const arg = statType === 'fstat' ?
await fs.promises.open(__filename, 'r') : __filename;
await fsPromises.open(__filename, 'r') : __filename;
let remaining = n;
bench.start();
while (remaining-- > 0)
await fs.promises[statType](arg);
await fsPromises[statType](arg);
bench.end(n);

if (typeof arg.close === 'function')
Expand Down
Loading