How to wait in milliseconds?

Hi this is a simple question, but is it possible to wait in milliseconds ?
I need it to do some BPM based animation and for my music sync in-game intro but it uses wait() and apparently using wait() is not a great idea in this script:

local tempo = 200 --BPM
local finished = true

repeat
	wait(60/tempo) -- Is there another way ?
	--Rest of the code
until finished == true

Wait only works in seconds, so there is no other way, doing 60/tempo works fine for now.

It’s also important to note that the minimum value for wait() is 0.03, so the fastest tempo you can do is 200 BPM.

1 Like

You can convert seconds to milliseconds through googling.

Here is 1 millisecond
wait(0.001)

Here is 100 milliseconds
wait(0.1)

And so forth.

that will probably cause the script to fail since wait() max is 0.03

Also someone recommended to use tick() maybe I could use this

1 Like

That precision is nearly impossible to do, even RunService events struggle to keep up with a millisecond yielding because the FPS cap commonly is 60 and 1/60, is more than 16 ms.

1 Like

Oh ok, then i’ll use something else, thanks