summaryrefslogtreecommitdiffstats
path: root/main.mjs
diff options
context:
space:
mode:
Diffstat (limited to 'main.mjs')
-rw-r--r--main.mjs8
1 files changed, 8 insertions, 0 deletions
diff --git a/main.mjs b/main.mjs
index 908aaa2..bcb7f0a 100644
--- a/main.mjs
+++ b/main.mjs
@@ -46,6 +46,14 @@ async function loaded() {
};
document.querySelector('#run').onclick = e => {
console.debug('run clicked', e);
+ const start = performance.now();
+ let tickCount = 0;
+ for (let i = 0; i < 1_000_000; i++) {
+ tickCount += interp.run();
+ }
+ const end = performance.now();
+ console.info(`run took ${end-start} ms for ${tickCount} ticks (${(end-start)/tickCount * 1000000} µs/tick).`);
+ console.info('result', interp.stack());
};
window.interp = interp;
}