minor stats changes

This commit is contained in:
azykov@mail.ru
2026-06-26 20:56:10 +03:00
parent bf7f803a99
commit b873286dfd
@@ -49,10 +49,15 @@ export const StatsLayer = function () {
]; ];
for (const [name, entry] of Object.entries(layerTimings)) { for (const [name, entry] of Object.entries(layerTimings)) {
const parts: string[] = []; const frameTime = entry.frame.frames > 0 ? (entry.frame.acc / entry.frame.frames) : 0;
parts.push(`frame ${(entry.frame.frames > 0 ? (entry.frame.acc / entry.frame.frames) : 0).toFixed(3)}`); const renderTime = entry.render.frames > 0 ? (entry.render.acc / entry.render.frames) : 0;
parts.push(`render ${(entry.render.frames > 0 ? (entry.render.acc / entry.render.frames) : 0).toFixed(3)}`); lines.push(
lines.push(`${name} ${parts.join(" ")} ms`); `${name} ${(renderTime + frameTime).toFixed(3)} ms` +
(frameTime > 0
? ` (${frameTime.toFixed(3)} frame)`
: ''
)
);
entry.frame.acc = 0; entry.frame.acc = 0;
entry.frame.frames = 0; entry.frame.frames = 0;