2015-11-11 07:36:50 +08:00
|
|
|
'use strict';
|
|
|
|
|
|
|
|
const common = require('../common');
|
|
|
|
const fs = require('fs');
|
2016-03-03 05:38:23 +08:00
|
|
|
const path = require('path');
|
2015-11-11 07:36:50 +08:00
|
|
|
|
|
|
|
const bench = common.createBenchmark(main, {
|
|
|
|
n: [1e4],
|
|
|
|
});
|
|
|
|
|
|
|
|
|
2017-12-30 10:57:52 +08:00
|
|
|
function main({ n }) {
|
2015-11-11 07:36:50 +08:00
|
|
|
bench.start();
|
|
|
|
for (var i = 0; i < n; i++) {
|
2016-03-03 05:38:23 +08:00
|
|
|
fs.readdirSync(path.resolve(__dirname, '../../lib/'));
|
2015-11-11 07:36:50 +08:00
|
|
|
}
|
|
|
|
bench.end(n);
|
|
|
|
}
|