minor stats changes
This commit is contained in:
@@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user