MCPcopy Create free account
hub / github.com/DFin/Neural-Network-Visualisation / constructor

Method constructor

assets/main.js:1790–1809  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1788
1789class FpsMonitor {
1790 constructor() {
1791 this.frameCount = 0;
1792 this.accumulatedTime = 0;
1793 this.lastTimestamp = 0;
1794 this.lastFrameTimestamp = 0;
1795 this.currentFps = null;
1796
1797 this.root = document.createElement("div");
1798 this.root.className = "fps-overlay";
1799
1800 this.valueElement = document.createElement("span");
1801 this.valueElement.className = "fps-overlay__value";
1802 this.valueElement.textContent = "— fps";
1803
1804 this.root.appendChild(this.valueElement);
1805 document.body.appendChild(this.root);
1806 this.refreshDisplay = this.refreshDisplay.bind(this);
1807 this.displayTimer = window.setInterval(this.refreshDisplay, 250);
1808 this.refreshDisplay();
1809 }
1810
1811 update(time) {
1812 if (!Number.isFinite(time)) return;

Callers

nothing calls this directly

Calls 1

refreshDisplayMethod · 0.95

Tested by

no test coverage detected