Since we run in a loop at 60Hz, or 60FPS if you like, how do I do something at 1 second intervals?
(don't know how to format code here)
var globalsleep = 1.0 - (1/60)
var prevdelta = 0.0
# get ready now
prevdelta += delta
if prevdelta >= globalsleep:
print("prevdelta = ",prevdelta)
prevdelta = 0.0
But there is always some time lost and prevdelta will be more than 1 second.
But that is strange because if I run and just print(" delta = ", delta) I see 1/60 or 0.0167
Something seems broken to me. I am using git master.
I hope someone can try to explain this but I think it's a bug. Or is there some kind
of global lock like python GIL? Which would mean that Godot is all in a single-thread.
Or am I misunderstanding some signficant design behavior?