From 4c67a10f265dde1c3aa430cb851062a38646d6f2 Mon Sep 17 00:00:00 2001 From: Ben Bridle Date: Sun, 7 Sep 2025 19:04:41 +1200 Subject: Measure run performance --- bedrock.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bedrock.js b/bedrock.js index a0155e7..0022346 100644 --- a/bedrock.js +++ b/bedrock.js @@ -1130,6 +1130,7 @@ function Bedrock(e) { this.wst = new Stack(); this.rst = new Stack(); this.dev = new DeviceBus(this); + this.mark = performance.now(); // Callback functions. this.onUpdate; @@ -1153,6 +1154,8 @@ function Bedrock(e) { this.mem.fill(0); this.mem.set(bytecode.slice(0, 65536)); this.blank = false; + this.mark = performance.now(); + console.log("Started new run"); } this.run = () => { @@ -1197,6 +1200,7 @@ function Bedrock(e) { this.halted = true; this.update(); this.render(); + console.log("Run completed in", performance.now() - this.mark, "milliseconds"); } this.sleep = () => { -- cgit v1.2.3-70-g09d2