I have the following situation: A Timer (wait_time = 1second) is started as soon as the scene initializes (e.g. with _ready() or with a signal emitted as soon as the scene initializes). This causes the timer to last significantly less than 1 second.
After some testing it seems like the frame after the signal is emitted the wait_time is significantly smaller than it should (see code below). Is this a bug or am I doing something wrong?
Minimal reproduction project: Single Timer node with the following script
I want to highlight that the same occurs when the timer is started with a signal (like on_area/mouse_entered) if the signal is emitted as soon as the scene is initialized.
As you can see in your output, the problem remains.
Note that your first print (when the timer starts) and the second one (when _on_timeout is called for the first time) differ by 0.982. As for me, when I run your script I get
Godot Engine v4.2.1.stable.official.b09f793f5 - https://godotengine.org
Vulkan API 1.3.262 - Forward Mobile - Using Vulkan Device #0: AMD - AMD Radeon RX 6650 XT
1723208356.287
1723208357.232
which gives a first difference of 0.945.
Seems like the magnitude of the issue is hardware-dependent, but the error is always noticeable.
The first couple of seconds could be off anyway, although the scene is up and running there could still be some background initialisation occuring. I get what you’re saying though. The best thing you could do is open it as a bug on github and see what happens.