Like someone else mentioned, task.wait is just faster and better, I am pretty sure ( correct me if I am wrong ) that is is equivalent to using RunService.HeartBeat:Wait().
the function wait is just bad practice nowdays, I never used wait again ever since I discovered task.wait()