Skip to content

Commit

Permalink
show tick percentage
Browse files Browse the repository at this point in the history
  • Loading branch information
IsaacThoman committed Jan 17, 2025
1 parent 1281af9 commit bb27246
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/client/ui/ChatOverlay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -425,10 +425,13 @@ export class ChatOverlay {
//linesToRender.push('playerMaxHealth: ' + this.networking.getServerInfo().playerMaxHealth);
//linesToRender.push('health: ' + this.localPlayer.health);
//linesToRender.push('pos:' +this.localPlayer.position.x.toFixed(2) + ',' + this.localPlayer.position.y.toFixed(2) + ',' +this.localPlayer.position.z.toFixed(2),);
const tickTimeMs = this.networking.getServerInfo().tickComputeTime * 1000;
const cleanupTimeMs = this.networking.getServerInfo().cleanupComputeTime * 1000;
const tickSpeedMs = 1 / this.networking.getServerInfo().tickRate * 1000;
const tickTimePercent = (tickTimeMs / tickSpeedMs) * 100;

linesToRender.push('tickTime: ' + (this.networking.getServerInfo().tickComputeTime * 1000).toFixed(2) + 'ms');
linesToRender.push('cleanupTime: ' + (this.networking.getServerInfo().cleanupComputeTime * 1000).toFixed(2) + 'ms');

linesToRender.push('tickTime: ' + tickTimeMs.toFixed(2) + 'ms (' + tickTimePercent.toFixed(2) + '%)');
linesToRender.push('cleanupTime: ' + cleanupTimeMs.toFixed(2) + 'ms');
for (const msg of this.localPlayer.gameMsgs2) {
linesToRender.push(msg);
}
Expand Down

0 comments on commit bb27246

Please sign in to comment.