for i = 1,100 do
print(i)
wait(1/100)
end
This for loop was meant to reach a 100 in one second because it runs a 100 times and waits 1/100th of a second (0.01) each and 100*0.01 is 1 second. But the code actually reaches a 100 in 4 seconds for some reason when I stopwatch it. Can anybody explain why and also a solution?

2 comments
The minimum wait time is 29 milliseconds. There is no guarantee the thread will wait exactly 29ms. 'print()' takes time too. There is no guarantee each loop will execute in a consistently timed manner.
Should've posted that as an answer m8