I have an event that needs to trigger every 1 second or so…
Accuracy is not a huge priority(it can be ± 30%). So I am wondering which of the following method is more efficient.
Using a timer that calls the function each second.
Or having a variable in the tick which checks if game time passed >1 second and call the function then update the existing variable at what game time the updating takes place.
So a FTimer is not that efficient compared to manually checking per Tick(provided I use the tick for something else too).
I think the Timer does something similar under the hood. Because say it put the the time period to be something like 0.03 and I check the gap in game time in which the event is triggered, the gap is not 100% accurate but it maintains an average of 0.03.
I seem to recall Timers not working in UDK for non-ticking actors, but since in UE4 timers are handled by a timer manager this becomes a possibility. uhmmm interesting
envenger: yep they do the same, and the timer will not hit at exactly 0.03 seconds (because the CPU will never reach it after exactly 0.030000 seconds)
still using timers seems more efficient in the long run, because if your actors don’t tick they won’t be processed by the tick list which in the end can make a bit of a difference in scenes with large amounts of actors