You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
741 B
20 lines
741 B
4 years ago
|
import { BaseHUDPart } from "../base_hud_part";
|
||
|
import { makeDiv, round3Digits } from "../../../core/utils";
|
||
|
|
||
|
export class HUDDebugInfo extends BaseHUDPart {
|
||
|
createElements(parent) {
|
||
|
this.element = makeDiv(parent, "ingame_HUD_DebugInfo", []);
|
||
|
|
||
|
this.tickRateElement = makeDiv(this.element, null, ["tickRate"], "Ticks /s: 120");
|
||
|
this.tickDurationElement = makeDiv(this.element, null, ["tickDuration"], "Update time: 0.5ms");
|
||
|
}
|
||
|
|
||
|
initialize() {}
|
||
|
|
||
|
update() {
|
||
|
this.tickRateElement.innerText = "Tickrate: " + this.root.dynamicTickrate.currentTickRate;
|
||
|
this.tickDurationElement.innerText =
|
||
|
"Avg. Dur: " + round3Digits(this.root.dynamicTickrate.averageTickDuration) + "ms";
|
||
|
}
|
||
|
}
|