An animation starts at 0 seconds. The async function resolves in 0.5 seconds. The &lt;code&gt;SetTimeout&lt;/code&gt; runs for 2 seconds. The animation stops at 2.5 seconds.