Add esprima-derived tests, trivial benchmark
This commit is contained in:
18
test/bench.html
Normal file
18
test/bench.html
Normal file
@@ -0,0 +1,18 @@
|
||||
<!doctype html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Acorn benchmark</title>
|
||||
<script src="../acorn.js"></script>
|
||||
<script src="jquery-string.js"></script>
|
||||
</head>
|
||||
|
||||
<button onclick="test()">GO</button>
|
||||
|
||||
<script>
|
||||
function test() {
|
||||
for (var i =0, t0 = +new Date; i < 10; ++i) acorn.parse(jquery164);
|
||||
var n = (+new Date - t0) + "ms";
|
||||
console.log(n);
|
||||
document.body.appendChild(document.createElement("pre")).innerHTML = n;
|
||||
}
|
||||
</script>
|
||||
Reference in New Issue
Block a user