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

Method refreshDisplay

assets/main.js:1835–1851  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1833 }
1834
1835 refreshDisplay() {
1836 const now = typeof performance !== "undefined" ? performance.now() : Date.now();
1837 const timeSinceLastFrame =
1838 this.lastFrameTimestamp > 0 ? now - this.lastFrameTimestamp : Number.POSITIVE_INFINITY;
1839
1840 if (!Number.isFinite(timeSinceLastFrame) || timeSinceLastFrame > 600) {
1841 this.valueElement.textContent = "idle";
1842 this.currentFps = null;
1843 return;
1844 }
1845
1846 if (this.currentFps !== null) {
1847 this.valueElement.textContent = `${this.currentFps} fps`;
1848 } else {
1849 this.valueElement.textContent = "— fps";
1850 }
1851 }
1852}
1853
1854class NeuralVisualizer {

Callers 2

constructorMethod · 0.95
updateMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected