Calculating time to the millisecond

Hi, how would I go about creating a timer that also has milliseconds in it?

This should help you calculate the time.

I’m a little lost from looking at that. Where would i even start?

you can just do a wait() with like 0.005 in it
and heart beat most of the time isnt completely acurate

wait() is on a different “path” than other normal code. This path is capped at 30hz, meaning the shortest wait() you can do is 0.03. It’d be faster to use Heartbeat:Wait() which is optimally 60hz.

Do you want to update a certain piece of code within a millisecond or do you just want elapsed time in milliseconds?

Not sure how you want to get time. But here is time to the millisecond using os.time…

--# Time in miliseconds since the epoch
math.floor( os.time() ) * 1000)

os.clock() or tick() give precise times. os.time() is only accurate to the second.