I would like to know why the Task.Wait duration ends up being different than the value being given
I was trying an idea that involved a looped script throttling itself when I noticed that it never reached above 45 times a second even though the duration value should be at or near 60hz at times
To confirm my suspicions I tested a few simple loops in both client and server scripts with
Task.Wait(1/60)
Task.Wait(0.0166)
Task.Wait(1/62)
Task.Wait(1/70)
Task.Wait()
game:GetService(“RunService”).Heartbeat:Connect(function())
all of which had a variable add to itself to count the amount of times its been looped per second every several seconds in a separate thread.
The result is Task.Wait(1/60) and Task.Wait(0.0166) ended up averaging about 40 times a second, Task.Wait(1/62) averaged 50 times a second, while all of the others averaged 60 times a second which is the the result I expected from all of them. I checked google and the devforum but couldnt anything mentioning something similar.