local Number = 0
while task.wait(1) do -- Fires every 1 second
Example.Text = "Temperature "..Number.."°C" -- concats Text
Number += 1 -- Adds Number
end
no it does not, It literally another form of loop:
RunService.RenderStepped:Connect(function(DeltaTime)
-- Fires in Code in Delta Time
end)
while true do
RunService.RenderStepped:Wait() -- Yields code in Delta Time
end
While loops aren’t bad for performance and whoever says that is wrong. Loops are a normal part of programming and they have minimal overhead. It’s a single opcode. They’re just about the most efficient thing you can make and Roblox has created optimizations specifically for while loops to make it even better.
You’re definitely confused. RunService is event-driven programming, and considering it fires 60 times per second, it will tank performance if used for intensive tasks that take longer than 16 milliseconds. A regular loop can be configured to avoid that, thus enhancing performance.