show max render time in debug stats

This commit is contained in:
Stewart Allen 2022-01-30 13:25:28 -05:00
commit 7aa579f9ab
2 changed files with 5 additions and 7 deletions

View file

@ -102,6 +102,7 @@
* `F` gcode output option as zip for multiple or flip ops or tool change * `F` gcode output option as zip for multiple or flip ops or tool change
* `F` maintain several part orientations + op chains in a single profile * `F` maintain several part orientations + op chains in a single profile
* `P` decrease cutting speed when entire tool is engaged (start of roughing)
* `P` port arc code from FDM export to CAM export * `P` port arc code from FDM export to CAM export
* `P` common part pre-analyze to speed up 'slice' and improve shadow (overhangs) * `P` common part pre-analyze to speed up 'slice' and improve shadow (overhangs)
* `P` redo all path route / planning in prepare to account for terrain before camOut * `P` redo all path route / planning in prepare to account for terrain before camOut

View file

@ -1285,8 +1285,7 @@
let animates = 0; let animates = 0;
let rateStart = Date.now(); let rateStart = Date.now();
let renders = 0; let renders = [];
let renderSum = 0;
let renderStart; let renderStart;
function animate() { function animate() {
@ -1297,17 +1296,15 @@
fps = 1000 * animates / delta; fps = 1000 * animates / delta;
animates = 0; animates = 0;
rateStart = now; rateStart = now;
renderTime = renders ? renderSum / renders : 0; renderTime = Math.max(0, ...renders);
renders = 0; renders.length = 0;
renderSum = 0;
} }
requestAnimationFrame(animate); requestAnimationFrame(animate);
if (docVisible && !freeze && Date.now() - lastAction < 1500) { if (docVisible && !freeze && Date.now() - lastAction < 1500) {
renderStart = Date.now(); renderStart = Date.now();
renderer.render(SCENE, camera); renderer.render(SCENE, camera);
renderSum += Date.now() - renderStart; renders.push(Date.now() - renderStart);
renders++;
} else { } else {
fps = 0; fps = 0;
} }