Is tick() more accurate than wait() function?

I’m asking beacuse i don’t know does it make any sense to make another wait function in order to make it more accurate.

local function Sleep (T)
     local RS = game:GetService("RunService")
     local S = tick()
     RS.RenderStepped:Connect(function()
             if T > tick()-S then
             end
     end)
end
1 Like

Any increase in accuracy from using tick() is probably nominal at best. Honestly, you’re probably better off just using wait() rather than calling a function and running a loop.

1 Like

This should be accurate, but the fact is that RunService events are the fastest at yielding. Use Event:Wait() instead of connecting a function, unless it was necessary for something else.

2 Likes

i’m going to use it for convay’s game of life.
So i want to make it generate step pretty fast.

1 Like

i remember when i hoped in minecraft codes and saw tick XD
for me i prefer wait i think its easier to work with.

1 Like

It is actually conway’s game of life

2 Likes

oh yeah…
I might didn’t read his name correctly.

I would recommend using tick() and avoiding wait().

Hm, yeah, as the others said, wait() is not really accurate. I even had a function that basically did the work in a better way without needing to use wait().

local RunService = game:GetService("RunService")

function WAIT(t)
	t = t or 0
	local start = tick()
	repeat
		RunService.Stepped:Wait()
	until (tick() - start) >= t
end
3 Likes