2016-02-20 09:03:16 +08:00
|
|
|
'use strict';
|
2015-06-06 08:43:48 +08:00
|
|
|
var common = require('../common.js');
|
|
|
|
var path = require('path');
|
|
|
|
|
|
|
|
var bench = common.createBenchmark(main, {
|
2016-02-06 11:23:29 +08:00
|
|
|
path: [
|
|
|
|
'',
|
|
|
|
'.',
|
|
|
|
'//server',
|
|
|
|
'C:\\baz\\..',
|
|
|
|
'C:baz\\..',
|
|
|
|
'bar\\baz'
|
|
|
|
],
|
|
|
|
n: [1e6]
|
2015-06-06 08:43:48 +08:00
|
|
|
});
|
|
|
|
|
|
|
|
function main(conf) {
|
|
|
|
var n = +conf.n;
|
2016-02-06 11:23:29 +08:00
|
|
|
var p = path.win32;
|
2017-04-17 09:01:12 +08:00
|
|
|
var input = String(conf.path);
|
2015-06-06 08:43:48 +08:00
|
|
|
|
|
|
|
bench.start();
|
|
|
|
for (var i = 0; i < n; i++) {
|
2016-02-06 11:23:29 +08:00
|
|
|
p.isAbsolute(input);
|
2015-06-06 08:43:48 +08:00
|
|
|
}
|
|
|
|
bench.end(n);
|
|
|
|
}
|