I have a little bar in my frame, and every .025 seconds, I expand it by 1% of the screen's width. I do this 40 times, so it should take 40 seconds. Here's the code:

local start = tick()
for i = 1, 40 do
	if hasReleased then break end

	gui.Frame.Bar.Size = UDim2.new(gui.Frame.Bar.Size.X.Scale + 0.01, 0, 0.1, 0)
	gui.Frame.Bar.Transparency = 0
	wait(.025)
	
	print(tick() - start)
end

But each time it prints, instead of increasing by .025, it seems to wait around .03 seconds:

Image

In case it matters, my Roblox Studio default wait() time is 0.010000000000000000208 aka 0.01

12 comments

0

It's only a 0.05 second difference, it isn't that obvious

0

Roblox's minimum wait is always going to be 0.029999..., I presume.

0

It's pretty obvious when I tell my users to wait for 1 second and ends up waiting for 1.333333 seconds.

0

But we're talking a 0.05 second difference.

0

OMG it adds up when I'm trying to wait 1 second...

0

Plus I get really OCD when it doesn't add up exactly to 1 second.

0

then do .2 LOL

0

what?

0

Don't do countdowns like this; do starttime - currenttime to get elapsed time because that doesn't suffer from delays like this

0

Could you elaborate?

0

Roblox are Updating on 1/30 seconds, you can't do the third decimal place.