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

function test() {
var i;
var t1 = Date.now();
for (i = 0; i < 1e6; i++) {
// Use a RegExp constructor call rather than a literal to ensure the
// RegExp is compiled on every loop.
var re = new RegExp('[\\u0000-\\uffff]', '');
}
print(((Date.now() - t1) / 1e6) + ' ms/test');
}
try {
test();
} catch (e) {
print(e.stack || e);
throw e;
}