mirror of https://github.com/svaarala/duktape.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
393 B
17 lines
393 B
9 years ago
|
function test() {
|
||
|
var i;
|
||
7 years ago
|
var t1 = Date.now();
|
||
|
for (i = 0; i < 1e6; i++) {
|
||
9 years ago
|
// Use a RegExp constructor call rather than a literal to ensure the
|
||
|
// RegExp is compiled on every loop.
|
||
7 years ago
|
var re = new RegExp('[\\u0000-\\uffff]', '');
|
||
9 years ago
|
}
|
||
7 years ago
|
print(((Date.now() - t1) / 1e6) + ' ms/test');
|
||
9 years ago
|
}
|
||
|
try {
|
||
|
test();
|
||
|
} catch (e) {
|
||
|
print(e.stack || e);
|
||
|
throw e;
|
||
|
}
|