Path: blob/main/files/en-us/web/api/animation/starttime/index.md
6532 views
------{{ APIRef("Web Animations") }}
The Animation.startTime property of the {{domxref("Animation")}} interface is a double-precision floating-point value which indicates the scheduled time when an animation's playback should begin.
An animation's start time is the time value of its {{domxref("DocumentTimeline","timeline")}} when its target {{domxref("KeyframeEffect")}} is scheduled to begin playback. An animation's start time is initially unresolved (meaning that it's null because it has no value).
Value
A floating-point number representing the current time in milliseconds, or null if no time is set. You can read this value to determine what the start time is currently set at, and you can change this value to make the animation start at a different time.
Examples
In the Running on Web Animations API example, the we can sync all new animated cats by giving them all the same startTime as the original running cat:
Reduced time precision
To offer protection against timing attacks and fingerprinting, the precision of animation.startTime might get rounded depending on browser settings. In Firefox, the privacy.reduceTimerPrecision preference is enabled by default and defaults to 20 µs in Firefox 59; in 60 it will be 2 ms.
In Firefox, you can also enabled privacy.resistFingerprinting, the precision will be 100ms or the value of privacy.resistFingerprinting.reduceTimerPrecision.microseconds, whichever is larger.
Specifications
{{Specifications}}
Browser compatibility
{{Compat}}
See also
{{domxref("Animation")}}
{{domxref("Animation.currentTime")}} for the current time of the animation.