Path: blob/main/files/en-us/web/api/animationeffect/getcomputedtiming/index.md
6520 views
------{{ APIRef("Web Animations API") }}
The getComputedTiming() method of the {{domxref("AnimationEffect")}} interface returns the calculated timing properties for this animation effect.
Note: These values are comparable to the computed styles of an Element returned using
window.getComputedStyle(elem).
Syntax
Parameters
None.
Return value
An object which contains:
all of the properties of the object returned by {{domxref("AnimationEffect.getTiming()")}}, except that any
"auto"values are replaced by computed values that may depend on the type of {{domxref("AnimationEffect")}}.the following additional properties:
endTime: A
numberindicating the end time of the effect in milliseconds from the effect's start. This is equal toactiveDurationplusdelayandendDelay.
activeDuration: A
numberindicating the total duration in milliseconds of all iterations of the effect. This is equal todurationmultiplied byiterations(or zero if that product would be {{jsxref("NaN")}}).
localTime: A
numberornull.Indicates the length of time in milliseconds that the effect has run. This is equal to the {{domxref("Animation.currentTime","currentTime")}} of the associated animation, or
nullif the effect is not associated with an animation.
progress:
nullor anumberat least0and less than1.Indicates the effect's progress through its current iteration. At the start of the
activeDuration, this equals the fractional part ofiterationStart.Returns
nullif the effect isn't mid-iteration, for example because the effect is in thedelayorendDelayperiods, the effect is finished, orlocalTimeisnull.
currentIteration:
nullor an integernumber.Indicates the index of the current iteration. At the start of the
activeDuration, this equals the integer part ofiterationStart.Returns
nullwheneverprogressisnull.
Specifications
{{Specifications}}
Browser compatibility
{{Compat}}
See also
{{domxref("AnimationEffect")}}
{{domxref("Animation")}}