my roblox studio countdown timer runs slower than real seconds

Made a round timer with a while loop and wait(1), but a 60 second round takes noticeably longer than a minute when the server is busy. Is there a better way to keep the timer accurate?
2

Leave A Reply

Log in to post an answer.

2 Answers

ella_afk Nov 12, 2026
santosh_respawn
if it's a round timer everyone sees, send the end time from the server and have clients compare against workspace:GetServerTimeNow() rather than their own clock. then every player's timer shows the same number and none of them drift.
denjoshep Oct 20, 2026
santosh_respawn
That's because wait(1) / task.wait(1) means "at least" one second, never exactly. Each loop adds a tiny bit of extra time and over a few minutes it drifts noticeably. Don't count down by subtracting 1 each loop. Store when it should end and work out what's left each time: local endTime = os.clock() + 60 while os.clock() < endTime do local left = math.ceil(endTime - os.clock()) -- update your text label with left task.wait(0.2) end If every player needs to see the same timer, do it on the server, or use workspace:GetServerTimeNow() so the clients agree with each other.