W3cubDocs

/Web APIs

AnimationEffect: getComputedTiming() method

The getComputedTiming() method of the 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

js

getComputedTiming()

Parameters

None.

Return value

An object which contains:

  • all of the properties of the object returned by AnimationEffect.getTiming(), except that any "auto" values are replaced by computed values that may depend on the type of AnimationEffect.
  • the following additional properties:
    endTime

    A number indicating the end time of the effect in milliseconds from the effect's start. This is equal to activeDuration plus delay and endDelay.

    activeDuration

    A number indicating the total duration in milliseconds of all iterations of the effect. This is equal to duration multiplied by iterations (or zero if that product would be NaN).

    localTime

    A number or null.

    Indicates the length of time in milliseconds that the effect has run. This is equal to the currentTime of the associated animation, or null if the effect is not associated with an animation.

    progress

    null or a number at least 0 and less than 1.

    Indicates the effect's progress through its current iteration. At the start of the activeDuration, this equals the fractional part of iterationStart.

    Returns null if the effect isn't mid-iteration, for example because the effect is in the delay or endDelay periods, the effect is finished, or localTime is null.

    currentIteration

    null or an integer number.

    Indicates the index of the current iteration. At the start of the activeDuration, this equals the integer part of iterationStart.

    Returns null whenever progress is null.

Specifications

Browser compatibility

Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari WebView Android Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet
getComputedTiming 75 79 63 No 62 13.1 75 75 63 54 13.4 11.0

See also

© 2005–2023 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/AnimationEffect/getComputedTiming