forked from udger/udger-nodejs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtry.js
More file actions
29 lines (22 loc) · 636 Bytes
/
Copy pathtry.js
File metadata and controls
29 lines (22 loc) · 636 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
// const main = './index.js';
const main = './index-alt.js';
const udgerParser = require(main)('udgerdb_v3.dat');
params = [{
ua:'Mozilla/5.0 (Windows NT 10.0; WOW64; rv:40.0) Gecko/20100101 Firefox/40.0',
ip:'66.249.64.73'
}, {
ua:'Googlebot/2.1 (+http://www.google.com/bot.html)',
ip:'192.168.0.1'
}]
runTest()
async function runTest() {
console.log(main)
for(let i = 0; i < 10; i++) {
console.time(i)
udgerParser.set(params[1]);
let ret = udgerParser.parse({ json: true });
console.timeEnd(i)
// beautify json output with 4 spaces indent
// console.log(JSON.stringify(ret, null, 4));
}
}