Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
2

Quick and simple question?

Asked by
funyun 958 Moderation Voter
9 years ago

Is wait(1/math.huge) faster than wait()?

0
1/math.huge is just 0 (check yourself). Don't do silly things like that -- you very rarely want to deal with infinities. BlueTaslem 18071 — 9y
0
It's the same as wait(0), so no. The fastest waits would be RunService.Stepped and RunService.RenderStepped( client scripts only ), for they fire 30 and 60 times a second, respectively. Diitto 230 — 9y

2 answers

Log in to vote
3
Answered by 9 years ago

wait() is faster; proven using some simple ticks. Seems to be a tad different of around .01 seconds:

bob = tick()
wait(1/math.huge)
now = tick()
print(now - bob,"---")
steve = tick()
wait()
john = tick()
print(john - steve)

Output: 0.046874284744263 --- 0.032794237136841

Ad
Log in to vote
1
Answered by
Dominical 215 Moderation Voter
9 years ago

The fastest available loop in ROBLOX is RunService:

local rs=game:GetService("RunService")
rs.RenderStepped:connect(function()
-- Put code to run every frame
end

Answer this question