diff options
| author | Brian Cully <bjc@spork.org> | 2025-08-23 12:16:01 -0400 |
|---|---|---|
| committer | Brian Cully <bjc@spork.org> | 2025-08-23 12:16:01 -0400 |
| commit | 8ce858ce7a03090b3b2a1310d17b1206f097637f (patch) | |
| tree | 1cfffdd378abc49f4d1f737b76a83f76224a14c8 /main.mjs | |
| parent | 5b8962e35836cf7ccbfdbca312f6b0eb9269e2a6 (diff) | |
| download | automathon-8ce858ce7a03090b3b2a1310d17b1206f097637f.tar.gz automathon-8ce858ce7a03090b3b2a1310d17b1206f097637f.zip | |
add some benchmarking
Diffstat (limited to 'main.mjs')
| -rw-r--r-- | main.mjs | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -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; } |
