diff options
author | Ben Bridle <ben@derelict.engineering> | 2025-09-07 19:04:41 +1200 |
---|---|---|
committer | Ben Bridle <ben@derelict.engineering> | 2025-09-07 19:04:41 +1200 |
commit | 4c67a10f265dde1c3aa430cb851062a38646d6f2 (patch) | |
tree | 2a6fbdb7e63e6e26d0fee086761ee679d602d224 | |
parent | 53fa574c9af4095f07f4883547939a25522f81e6 (diff) | |
download | bedrock-js-4c67a10f265dde1c3aa430cb851062a38646d6f2.zip |
Measure run performance
-rw-r--r-- | bedrock.js | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -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 = () => { |