Task.spawn vs coroutine.wrap what is more efficient and better practise

Pretty much do the same thing as the task library came out is it better to use task.spawn?

1 Like

I initially had the suspicion that calling coroutine.wrap() might be quicker, as task.spawn() works through Roblox’s scheduler. However after time-stamping both functions, I’ve come to the conclusion they seem to execute at essentially the same time. Though I’d be skeptical that this might change in cases where the scheduler is particularly busy, as these tests were ran in an empty place.

In light of this; I’d say that task.spawn() should likely be preferred in most cases, as it doesn’t obscure error information, and has no noticeable performance difference.

4 Likes