Three.js requestanimaframe

I’m not 100% sure I understand, but wouldn’t this work :face_with_raised_eyebrow: ?

const animate = function () {
  requestAnimationFrame( animate );

  mesh.rotation.x += speed;
  speed = Math.max( 0, speed - 0.01 );

  renderer.render( scene, camera );
}