Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

What's laggier? While true do wait(), or RenderStepped?

I've been curious about how well RenderStepped really runs. In a client-side script, I have a While true do loop and a RenderStepped. Both are performing the same exact operations, using Tick to update a value every one second.

Which one would hog the most CPU?

5 comments

0

What is the point of doing this? They're both separate that have nothing to do with each other.

0

Well considering RenderStepped runs 60 frames per second which equals to running every 0.0166 seconds and a while loop using wait() would run about every 0.03 seconds. RenderStepped would cost more CPU because it's called more often and should be used for updating the client's visuals as it is fired every frame. I would recommend using the loop with wait,, tick for updating a value every second.

0

If a client's framerate drops then RenderStepped would fire less often which would leave you with getting incorrect results for updating the value every second. Using wait would actually yield the thread for the x amount of time and not count on the client's frame rate

0

i really think that renderstepped is laggier, i really don't know, its just my inference, because I used while true do wait() often and it doesn't lag as much

0

try both if you want to see what is more laggier

1 answer

It's not the while true do wait() loop or RenderStep that's laggy. It is what operations you perform in the loop or event.

I only use RenderStep for animations (which is supposed to smooth and therefore requires to be updated as often as possible). You rarely need to use RenderStepped for something else.

If you want me to help you even further, I need more context than what's more CPU intensive. None of them will create lag unless you do heave operations.

This discussion is preserved as it was. New answers, comments, and votes are closed.