@seanox/aspect-js
Version:
full stack JavaScript framework for SPAs incl. reactivity rendering, mvc / mvvm, models, expression language, datasource, routing, paths, unit test and some more
52 lines (49 loc) • 1.62 kB
HTML
<html>
<head>
<meta charset="ISO-8859-1">
<title>Seanox aspect-js test environment</title>
<style>
body {
font-family: monospace;
white-space: pre;
}
</style>
<script src="aspect-js.js"></script>
<script type="text/javascript">
Test.activate();
// 1: Blink 250 / 190 i5-1240P
// 1: WebKit --- / 565 iPad Gen 10
// 1: goanna --- / 2075 i5-1240P
let source;
Composite.listen(Composite.EVENT_RENDER_END, () => {
source = Test.read("scripting_parse_benchmark.js");
let timeout1;
if (navigator.engine === "blink") {
timeout1 = 250;
}
if (navigator.engine === "webkit") {
timeout1 = 575;
}
if (navigator.engine === "goanna") {
timeout1 = 4000;
}
Test.create({timeout:timeout1, test() {
document.body.innerText += "Start 2500 runs\n";
const timing = Date.now();
for (let count = 0; count < 2500; count++) {
try {Scripting.eval(source);
} catch (error) {
Assert.fail(error.message);
}
}
document.body.innerText += "Timing " + (Date.now() -timing) + "\n";
console.log(`Benchmark 1: ${Date.now() -timing}ms`);
}});
Test.start();
});
</script>
</head>
<body>
</body>
</html>