Returning faster or not is not the concern here.
That is my point.
It is functionally equivalent. There is a default value set. Even by switching the Heartbeat:Wait()
to wait()
there would have achieved the exact same effect. If wait
is such a bad utility it would have been deprecated and replaced.
That isn’t my point, my point was just to address how Heartbeat.Wait
can be faster and is much reliable than wait
and they aren’t equivalent in terms of accuracy and yielding, this is an false claim.
@Feedekaiser
PS:
They are functionally equivalent with a minor difference. You SHOULD account for the delta time anyways.
This is completely irrelevant, we are talking about yielding, not using delta time. You don’t use delta time for yielding unless you want to create your own function.
If wait
is such a bad utility it would have been deprecated and replaced.
No, wait
should be used when it needs to be and you don’t care about exact accuracy. I never said it was a bad function, it should be used when it needs to be.
Sure in loops where we do not have to concern ourselves with the delta time, it is better suited to use Heartbeat.Connect
, just like what this page have told us to.
Have you even read the properly? You’re creating an unnecessary thread (Heartbeat.Connect)
and that is definitely not needed for yielding: you need to yield the current thread, not the one created by Heartbeat.Connect
.
That page has never stated to use Heartbeat.Connect
for yielding and hence, your point is completely false.
(we should almost always account for the delta if you still haven’t noticed by now), and it is still affected by lag just as much as wait
do.
Like I said, Heartbeat.Wait
isn’t affected by “lag” as wait
, it is much more reliable and accurate when compared to wait
, if wait
is affected, sure Heartbeat.Wait
will be but since it isn’t bound to the 30hz frequency, the affect won’t be as bad as compared to wait
and is mostly unnoticeable, refer to my benchmark above.
There is no point in arguing pointlessly with false claims.