Atlaslog
Atlaslog / three.js / API reference / Clock
three.js · API reference

Clock

Quick answer

Clock is a lightweight timer that reports seconds since the previous getDelta() call and total elapsed time since start(). Drive animations with getDelta() instead of frame counts so motion stays consistent across 60 Hz and 144 Hz displays. Set autoStart to false when you want explicit control over when timing begins.

Last verified 2026-11-03 · three.js 0.160.0 · Cite this page
new THREE.Clock ( autoStart ) → Clock
Key points
Example
const clock = new THREE.Clock();

renderer.setAnimationLoop(function () {
  const dt = Math.min(clock.getDelta(), 0.1);

  mesh.rotation.y += dt * 0.8;
  mesh.position.y = Math.sin(clock.elapsedTime * 1.4) * 0.3;

  renderer.render(scene, camera);
});
clock.stop();
clock.start();
clock.start();
clock.elapsedTime = 0;
Notes
Runnable examplesChinese originalAll API references
English edition written for Atlaslog. Code is taken from the original Chinese page and runs unchanged.
Cite this page

Atlaslog (2026). Clock. https://www.jingweizhi.com/en/three/api/clock.html (accessed 2026-11-03).