# Are timers not Independent of fps? (screenshots inside)

**URL:** <https://forums.unrealengine.com/t/are-timers-not-independent-of-fps-screenshots-inside/2483481>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine, question\
**Created:** [April 30, 2025, 2:44pm UTC](https://forums.unrealengine.com/t/are-timers-not-independent-of-fps-screenshots-inside/2483481 "2025-04-30T14:44:27Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Userofunreal](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Userofunreal](https://forums.unrealengine.com/u/Userofunreal)\
**Post date:** [April 30, 2025, 2:44pm UTC](https://forums.unrealengine.com/t/are-timers-not-independent-of-fps-screenshots-inside/2483481/1 "2025-04-30T14:44:27Z")

</div>

TLDR: only in 60fps timers keep correct scaling between 1.0 and 0.05 (or any other), why is that? how to get a timer that always constant in result?

i have created multiple timers with different number of calls per second. and expected them to be equal in scale under any fps as they should all resemble “time”.

But it seems that different calls per seconds, will give different results under different FPS. /  
I expected 0.05 timer to be always 20 times more calls then 1.0 timer. but that is only true if FPS is 60

 ![Screenshot 2025-04-30 at 8.10.00 PM](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/8/a/f8a758252e89a0c2e46b24d783759c70fe659aa2.jpeg)  
.

I used t.maxFPS command to limit fps in all tests.

Maybe my own understanding is fundamentally wrong (most likely). it seems like you can only use timers if all of them across the game have the same number of calls per second. otherwise fps changes and their result changed as well.

Tests made 20 sec each using my phone’s timer (0.2-0.5sec error of my finger press)  
Print string:  
1 - purple, 1 sec timer  
0.1 - green, 0.1 timer  
0.05 - orange, 0.05 timer

 ![Screenshot 2025-04-30 at 8.03.33 PM](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/0/6/a066f57961a9d19b3a4996c97200923fbaee8acf.jpeg)  
 ![Screenshot 2025-04-30 at 8.05.13 PM](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/b/6/9b6573531b49ce123685de958201ec4d702fdbeb.jpeg)  
 ![Screenshot 2025-04-30 at 8.06.08 PM](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/6/5/a6578f54d198621cc7132fae742035068fdbca43.jpeg)  
 ![Screenshot 2025-04-30 at 8.07.06 PM](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/6/9/669e166c414f929d9c57d7f797048fd88c18b37f.jpeg)

---

<div class="post-metadata">

**Author:** ![PREDALIEN](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/predalien/32/1194670_2.png) [@PREDALIEN](https://forums.unrealengine.com/u/PREDALIEN)\
**Post date:** [April 30, 2025, 3:00pm UTC](https://forums.unrealengine.com/t/are-timers-not-independent-of-fps-screenshots-inside/2483481/2 "2025-04-30T15:00:29Z")

</div>

> [@Userofunreal](#):
>
> why is that?

Limiting the precision of floating point values(?)

If (most likely this is the case) the error does not accumulate, then everything is correct.

The problem (peculiarity) is that the timer will not be called exactly after the specified time, it will be called in the nearest frame after at least the specified time.

60 frames per second is about 0.016 per frame.  
So the timer at 0.05 will actually go off at frame 4, or through 0.064 seconds. The next one will go off at frame 7 (0.112 seconds from the start).

---

<div class="post-metadata">

**Author:** ![jwatte](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/jwatte/32/744941_2.png) [@jwatte](https://forums.unrealengine.com/u/jwatte)\
**Post date:** [April 30, 2025, 3:01pm UTC](https://forums.unrealengine.com/t/are-timers-not-independent-of-fps-screenshots-inside/2483481/3 "2025-04-30T15:01:44Z")

</div>

> [@Userofunreal](#):
>
> how to get a timer that always constant in result?

This is at the end a sampling theorem problem – your main loop doesn’t run at a perfect 60 Hz, and thus any timers will be quantized to when the main loop/tick happens to actually run.

The most accurate way to deal with this, is to get the current game time inside tick, and accumulate that to a variable. Then enter a loop that checks whether the variable is greater than 1/60, if so, subtract 1/60 from the variable, run your “one tick” function, and then check the loop again. If a particular frame takes longer to run, you’ll run your “one tick” function more than once in a single game loop tick.

---

<div class="post-metadata">

**Author:** ![Userofunreal](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Userofunreal](https://forums.unrealengine.com/u/Userofunreal)\
**Post date:** [April 30, 2025, 3:30pm UTC](https://forums.unrealengine.com/t/are-timers-not-independent-of-fps-screenshots-inside/2483481/4 "2025-04-30T15:30:25Z")

</div>

> [@jwatte](#):
>
> tion more than once in

Thank you for your detailed answer !  
Is it possible to see an example for that? im not really sure how to approach to execute such a blueprint

---

<div class="post-metadata">

**Author:** ![Userofunreal](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Userofunreal](https://forums.unrealengine.com/u/Userofunreal)\
**Post date:** [April 30, 2025, 3:36pm UTC](https://forums.unrealengine.com/t/are-timers-not-independent-of-fps-screenshots-inside/2483481/5 "2025-04-30T15:36:39Z")

</div>

So i have to have more fps then number of calls on my timer?

---

<div class="post-metadata">

**Author:** ![PREDALIEN](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/predalien/32/1194670_2.png) [@PREDALIEN](https://forums.unrealengine.com/u/PREDALIEN)\
**Post date:** [April 30, 2025, 5:59pm UTC](https://forums.unrealengine.com/t/are-timers-not-independent-of-fps-screenshots-inside/2483481/6 "2025-04-30T17:59:58Z")

</div>

You need one (the most frequent) timer (0.05 in this case). Then count how many times it has triggered.  
Every second triggering means that 0.1 has passed.  
Every 20 means that a second has passed.

In this case, the number of short calls in one long one will always be the same.

---

<div class="post-metadata">

**Author:** ![jwatte](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/jwatte/32/744941_2.png) [@jwatte](https://forums.unrealengine.com/u/jwatte)\
**Post date:** [May 1, 2025, 10:29pm UTC](https://forums.unrealengine.com/t/are-timers-not-independent-of-fps-screenshots-inside/2483481/7 "2025-05-01T22:29:57Z")

</div>

> [@PREDALIEN](#):
>
> Then count how many times it has triggered.

This is exactly the wrong way to do it, because if your frames take longer than 50 ms to render, you will get fewer than 20 triggers in a second.

The way to do it is:

`MyActorClass`

- `TimeAccumulator: float`  
`Tick:`
- `TimeAccumulator += DeltaTime`
- `while (TimeAccumulator > 0):`
- 
  - `RunOnce()`

- 
  - `TimeAccumulator -= TimePerOneRun`

If you want to run 200 times per second, `TimePerOneRun` is `1.0/200` or `0.005` for example.

---

<div class="post-metadata">

**Author:** ![PREDALIEN](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/predalien/32/1194670_2.png) [@PREDALIEN](https://forums.unrealengine.com/u/PREDALIEN)\
**Post date:** [May 2, 2025, 11:49am UTC](https://forums.unrealengine.com/t/are-timers-not-independent-of-fps-screenshots-inside/2483481/8 "2025-05-02T11:49:48Z")

</div>

Your solution looks more correct than mine. 😗

But if the main problem was that the number of triggers was stable, and to agree that the short interval would not be shorter than the frame - then my solution, simpler in my opinion, also has a place to be.

---

<div class="post-metadata">

**Author:** ![Userofunreal](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Userofunreal](https://forums.unrealengine.com/u/Userofunreal)\
**Post date:** [May 6, 2025, 11:08pm UTC](https://forums.unrealengine.com/t/are-timers-not-independent-of-fps-screenshots-inside/2483481/9 "2025-05-06T23:08:28Z")

</div>

Thank you, i will test that implement. right now i linked the attack speed to the number of calls, it give me an “ok” results. better then before. but i want more control

---

<div class="post-metadata">

**Author:** ![Chatouille](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/chatouille/32/1194622_2.png) [@Chatouille](https://forums.unrealengine.com/u/Chatouille)\
**Post date:** [May 7, 2025, 8:59am UTC](https://forums.unrealengine.com/t/are-timers-not-independent-of-fps-screenshots-inside/2483481/10 "2025-05-07T08:59:06Z")

</div>

Your timers in original post are not looping.. What is calling them repeatedly ?

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/1/7/617b9a6f107653845033bcfe0bc1975aae6cf329.jpeg)

---

<div class="post-metadata">

**Author:** ![chrudimer](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/chrudimer/32/918651_2.png) [@chrudimer](https://forums.unrealengine.com/u/chrudimer)\
**Post date:** [May 7, 2025, 11:43am UTC](https://forums.unrealengine.com/t/are-timers-not-independent-of-fps-screenshots-inside/2483481/11 "2025-05-07T11:43:58Z")

</div>

Hi, as far as I know timers are framerate independent, but in the code you have shown in the first image of the original post essentially doesn’t use timers, but a delay and recursive calling the event (which very likely won’t be framerate independent). If you want to use timers, then you would need to set the timer once and set it to looping 🙂 (i.e. one event that sets the timer and one event that gets called every X seconds).

So as far as I know e.g. a timer set to looping every 0,05 seconds may not be called exactly every 0.05 seconds but will be called every 0,05 seconds on average, even if it means it being called several times in a row in a single frame (e.g. if one frame ends at 0,04s and the second at 0,12s (second frame taking 0,08s), then the timer would be called twice after the second frame). Whereas in you current setup, it would only be called once after the second frame (you get an error for every frame that is longer than 0,05s, therefore your current setup only works if the frametime is a multiple of 0,05s (which 60fps is)).

---

<div class="post-metadata">

**Author:** ![Userofunreal](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Userofunreal](https://forums.unrealengine.com/u/Userofunreal)\
**Post date:** [May 7, 2025, 12:41pm UTC](https://forums.unrealengine.com/t/are-timers-not-independent-of-fps-screenshots-inside/2483481/12 "2025-05-07T12:41:46Z")

</div>

I don’t know, i just call them all from begin play one after the other

---

<div class="post-metadata">

**Author:** ![Userofunreal](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Userofunreal](https://forums.unrealengine.com/u/Userofunreal)\
**Post date:** [May 7, 2025, 12:42pm UTC](https://forums.unrealengine.com/t/are-timers-not-independent-of-fps-screenshots-inside/2483481/13 "2025-05-07T12:42:30Z")

</div>

Thank you sir, can you show an example that shows the difference? it will help me a great deal

---

<div class="post-metadata">

**Author:** ![Chatouille](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/chatouille/32/1194622_2.png) [@Chatouille](https://forums.unrealengine.com/u/Chatouille)\
**Post date:** [May 7, 2025, 12:48pm UTC](https://forums.unrealengine.com/t/are-timers-not-independent-of-fps-screenshots-inside/2483481/14 "2025-05-07T12:48:25Z")

</div>

I detailed this a bit in another post, see

> [@Are Timers frame dependent? Or no?](https://forums.unrealengine.com/t/are-timers-frame-dependent-or-no/1803838/13):
>
> This is more than a bit surprising. Also, I cannot reproduce it. As far as I can tell, looping timer will always trigger more often than a Delay-loop of the same interval. This is because looping timers look back in time, can trigger multiple times per frame if necessary, and apply overtime to the next interval. For example with a looping timer of 0.1, if a frame takes 0.4s then the timer will trigger 4 times at once. Delays on the other hand are like timers with no looping, so they’ll trigge…

Note that using a delay-loop or non-looping timer is essentially the same, as chrudimer pointed above. Your case looks like a good example of a small overtime error accumulating with every trigger. A looping timer would fix that right away.

---

<div class="post-metadata">

**Author:** ![chrudimer](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/chrudimer/32/918651_2.png) [@chrudimer](https://forums.unrealengine.com/u/chrudimer)\
**Post date:** [May 7, 2025, 2:04pm UTC](https://forums.unrealengine.com/t/are-timers-not-independent-of-fps-screenshots-inside/2483481/15 "2025-05-07T14:04:00Z")

</div>

Sure, here is an example of a looping timer:

 ![Screenshot 2025-05-07 160128](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/9/4/f942d73d473781fcb67a74c74d255c53ffc42807.png)

---

<div class="post-metadata">

**Author:** ![Userofunreal](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Userofunreal](https://forums.unrealengine.com/u/Userofunreal)\
**Post date:** [May 7, 2025, 4:48pm UTC](https://forums.unrealengine.com/t/are-timers-not-independent-of-fps-screenshots-inside/2483481/16 "2025-05-07T16:48:22Z")

</div>

> [@Chatouille](#):
>
> looping timer would fix

Oh, i already performed that in a different post due to the use of an interface. i was forced to designed it that way instead of connecting both the execution and the delegate into the event.

Did not knew it will “normalize” the time and compensate on missing frames.

---

<div class="post-metadata">

**Author:** ![Userofunreal](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Userofunreal](https://forums.unrealengine.com/u/Userofunreal)\
**Post date:** [May 7, 2025, 4:51pm UTC](https://forums.unrealengine.com/t/are-timers-not-independent-of-fps-screenshots-inside/2483481/17 "2025-05-07T16:51:03Z")

</div>

Bro deleted 2 folders and timers went accurate, isn’t that scary ?

---

<div class="post-metadata">

**Author:** ![Userofunreal](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Userofunreal](https://forums.unrealengine.com/u/Userofunreal)\
**Post date:** [May 8, 2025, 9:05pm UTC](https://forums.unrealengine.com/t/are-timers-not-independent-of-fps-screenshots-inside/2483481/18 "2025-05-08T21:05:31Z")

</div>

Guys, can i reset the timer to start?

Lets say its 50% of a sec, can i force him to go back to zero of a sec at a given moment? how to do that? in blueprint

---

<div class="post-metadata">

**Author:** ![Userofunreal](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Userofunreal](https://forums.unrealengine.com/u/Userofunreal)\
**Post date:** [May 10, 2025, 12:49pm UTC](https://forums.unrealengine.com/t/are-timers-not-independent-of-fps-screenshots-inside/2483481/19 "2025-05-10T12:49:50Z")

</div>

Apologies for doable reply, may any of you know how to reset the timer back to 0 in a given moment ? (frame?)

@Chatouille @RedGrimnir @jwatte @PREDALIEN

---

<div class="post-metadata">

**Author:** ![RedGrimnir](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/redgrimnir/32/1054683_2.png) [@RedGrimnir](https://forums.unrealengine.com/u/RedGrimnir)\
**Post date:** [May 11, 2025, 1:24pm UTC](https://forums.unrealengine.com/t/are-timers-not-independent-of-fps-screenshots-inside/2483481/20 "2025-05-11T13:24:59Z")

</div>

Go download this [LE Extended Standard Library | Fab](https://www.fab.com/listings/0aadd41b-c02d-4f63-9009-bffad0070ebc) its free, it comes it very handy bunch of nodes including a node with “DelayFrames” .

Delay whatever frames you need then for timer : use clear and invalidate timer. and run timer again.

[Next page](https://forums.unrealengine.com/t/are-timers-not-independent-of-fps-screenshots-inside/2483481.md?page=2)
