ok so i’ve been using task.wait() for a while now just because everyone said to switch from wait() but honestly i never really understood why
like i just replaced all my wait()s with task.wait() at some point and moved on lol. does it actually do anything different or is it just the “newer” way of writing the same thing
-- i just use this now without really knowing why
task.wait(1)
-- instead of this
wait(1)
is there an actual performance difference or does it not really matter for small games? asking bc i wanna actually understand what im using instead of just copying what others do
wait throttles at 30hz, meaning it will not leverage greater precision and can yield for longer than requested. task.wait leverages frame/simulation rate, which enables it to improve the accuracy at which your thread sleeps for the targeted amount of time.
task.wait basically doesnt care about lag, while wait does, if you lagged wait(1) would be more like 2 seconds, task.wait(1) would still be wait 1 second even if you lagged (thats what i understood of it atleast)