Skip to main content
Question

Figma "after delay" not exact?

  • February 3, 2023
  • 4 replies
  • 1380 views

Tascha

So I was trying to make a simple timer that counts up seconds, minutes and so on.

I found this “Timer Animation” Community file which does exactly that:

Figma

However, I noticed on this (and the few other files/videos I found) that the timing of the seconds as soon as it becomes 2-digits (so starting at 10 seconds) is never quite right - the 1 always appears a bit too soon (so before the 9 becomes a 0).

I just wondered why that is? I believe the file is set up right with the correct ms for delay… So is the “after delay” interaction just not exact? So if you set 1000ms it’s just a bit short of that? Or am I missing something? Maths isn’t my strong suit 😂

I’d love to hear your assumptions/knowledge/ideas 🙃

This topic has been closed for replies.

4 replies

Gleb
  • Power Member
  • 4708 replies
  • February 3, 2023

This is a common problem in all real-time graphics-intensive applications, mostly games. It depends on the engine / render loop implementation. In case of Figma, it probably works like this:

  1. 0ms: Frame 1 is rendered. The timer starts.
  2. 1000ms: Timer ends, Frame 2 starts rendering.
  3. … It takes several milliseconds to render the frame.
  4. 1200ms: Frame 2 is rendered. The new timer starts.
  5. 2200ms: Timer ends, Frame 3 starts rendering…

… etc. Every render loop the time it takes to render an image is taken into account of the timer. It takes a while to start a new timer. And since there is no mechanic in Figma to make a real loop, instead you create a new timer transition every time, so there is no way to take this delay of 200ms into account. (1000ms is 1 second)


Tascha
  • Author
  • Active Member
  • 32 replies
  • February 3, 2023

Ah, that makes sense! Thank you for the quick answer @Gleb 🙃

I wonder if there’s any way to set the time so you can take the render frames into consideration 🤔


Gleb
  • Power Member
  • 4708 replies
  • February 3, 2023

That would depend on the performance of the device. But you can always set the delay slightly shorter for numbers that change more often. Find the optimal number through experiments. Or abandon the idea of using transitions for this and create a GIF instead.


Tascha
  • Author
  • Active Member
  • 32 replies
  • February 6, 2023

Thanks a lot @Gleb - still sad it’s not working perfectly out of the box 😅 But yeah I just might leave it a bit wonky… Although the gif idea would be worth a shot just out of curiosity!

Thanks agan! 😊


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings