Skip to content

Instantly share code, notes, and snippets.

@flushpot1125
Created May 14, 2023 06:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save flushpot1125/170f22e290da4924e30d1f678e64f510 to your computer and use it in GitHub Desktop.
Save flushpot1125/170f22e290da4924e30d1f678e64f510 to your computer and use it in GitHub Desktop.
engine.runRenderLoop(() => {
const startCPUTime = BABYLON.PrecisionDate.Now;
scene.render();
const endCPUTime = BABYLON.PrecisionDate.Now;
t = (t + 1) % 10;
// Prevent hammering the composition.
if (t === 0) {
divFps.innerHTML = engine.getFps().toFixed() + " fps - " + ((endCPUTime - startCPUTime)).toFixed(2) + " CPU ms";
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment