summaryrefslogtreecommitdiffstats
path: root/site/bench.mjs
diff options
context:
space:
mode:
Diffstat (limited to 'site/bench.mjs')
-rw-r--r--site/bench.mjs13
1 files changed, 13 insertions, 0 deletions
diff --git a/site/bench.mjs b/site/bench.mjs
new file mode 100644
index 0000000..ea88f6b
--- /dev/null
+++ b/site/bench.mjs
@@ -0,0 +1,13 @@
+// todo: put this on a different page just for benching
+
+// document.querySelector(BENCH_BUTTON_SELECTOR).onclick = e => {
+// console.debug('bench clicked', e);
+// const start = performance.now();
+// let tickCount = 0;
+// for (let i = 0; i < 1_000_000; i++) {
+// tickCount += robo.vm.run();
+// }
+// const end = performance.now();
+// console.info(`run took ${end-start} ms for ${tickCount} ticks (${(end-start)/tickCount * 1_000_000} ns/tick).`);
+// console.info('result', robo.vm.stack());
+// };