minor stats changes
This commit is contained in:
@@ -49,10 +49,15 @@ export const StatsLayer = function () {
|
||||
];
|
||||
|
||||
for (const [name, entry] of Object.entries(layerTimings)) {
|
||||
const parts: string[] = [];
|
||||
parts.push(`frame ${(entry.frame.frames > 0 ? (entry.frame.acc / entry.frame.frames) : 0).toFixed(3)}`);
|
||||
parts.push(`render ${(entry.render.frames > 0 ? (entry.render.acc / entry.render.frames) : 0).toFixed(3)}`);
|
||||
lines.push(`${name} ${parts.join(" ")} ms`);
|
||||
const frameTime = entry.frame.frames > 0 ? (entry.frame.acc / entry.frame.frames) : 0;
|
||||
const renderTime = entry.render.frames > 0 ? (entry.render.acc / entry.render.frames) : 0;
|
||||
lines.push(
|
||||
`${name} ${(renderTime + frameTime).toFixed(3)} ms` +
|
||||
(frameTime > 0
|
||||
? ` (${frameTime.toFixed(3)} frame)`
|
||||
: ''
|
||||
)
|
||||
);
|
||||
|
||||
entry.frame.acc = 0;
|
||||
entry.frame.frames = 0;
|
||||
|
||||
Reference in New Issue
Block a user