files/en-us/web/api/animationeffect/updatetiming/index.md
{{ APIRef("Web Animations") }}
The updateTiming() method of the {{domxref("AnimationEffect")}} interface updates the specified timing properties for an animation effect.
updateTiming(timing)
timing {{optional_inline}}
None ({{jsxref("undefined")}}).
updateTiming() may cause any associated {{domxref("Animation")}} to start or stop playing, if for example the effect of a running animation is shortened such that its end time is before {{domxref("Animation.currentTime")}} or the effect of a finished animation is lengthened such that its end time is after {{domxref("Animation.currentTime")}}.
const animation = document.body.animate([], { duration: 1000 });
animation.finish();
console.log(animation.playState); // finished
animation.effect.updateTiming({ duration: 2000 });
console.log(animation.playState); // running
{{Specifications}}
{{Compat}}