What is the minimum wait time for a Timer ?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By anthonyyaghi

Hello, I am working on my first Godot game and I am facing a small issue. It seems the timer wait time is not working properly for small values. I thought the engine had some kind of a minimum wait time value but I can’t find anything online. Maybe it is caused by the way the timer is implemented ?

Here is my code, I am just filling the cells of a grid with a delay to have some kind of an animation, but it can’t go faster after a certain wait time:

for row in range(grid_heigth):
	for col in range(grid_width):
		set_cell(col, row, GREY_CELL)
		yield(get_tree().create_timer(0.001), "timeout")
1 Like
:bust_in_silhouette: Reply From: Andrea

i believe the timer checks on every frame how much time passed from the start. i dont know what system you have, but on my PC a typical frame is something around 0.01s.
So, if you set 0.001s of wait time, with a single frame after start you already passed the wait time.
So yeah, the lower limit is the frame time.

Beside, even if the timer was able to wait 0.001s, your brain wouldn’t be able to tell