Does Roblox Studio's "wait(number)" accurate to real life time?

I’m trying to add a cooldown to my looting system, but I’m not sure if roblox’s time is accurate to real life. (i.e: one second in roblox = 1 second in real life). If not, is there some way to convert it?

1 Like

changed: maybe yes? or not?? actually my roblox wait() is more faster

1 Like

It is. wait(1) will wait approximately 1 second in real life. It’ll work just fine for your cooldown.

1 Like

It is accurate, but not as accurate as using task.wait(1) , it updates much faster then wait(1) and now there really isn’t any reason you should be using wait(1) over task.wait(1).

You can read more on it here:

2 Likes

task.wait(1) should be as close to 1 second as you can possibly get. Trying to get it any more accurate is just going to be a waste of effort and will probably make your code more unoptimised.

1 Like

According to Roblox Globals, wait “yields the current thread until the specified amount of seconds has elapsed”. So yes, the number of seconds yielded correlates to real-life time.

P.S. wait was superseded by task.wait, which, on average, resumes 2x faster than wait.

task.wait() is way faster than wait()

I would probably not do any wait, Instead I would do a tick() debounce as this will be most accurate

1 Like

task.wait(1)

Will wait 1 second and then on the next heartbeat resume your code

So if the heartbeat is running at 60 FPS

Then there is a chance that task.wait will wait

1.0166666 seconds so it’s very close to 1 second in real life

If you want to learn more this video will help

1 Like