How to accurately measure time passed without deprecated functions

I am trying to measure the time a player holds down their mouse button (on a tool) for. I understand the actual events to do this, but I am not sure on which time function to use. It should be precise, using decimals. I have looked at tick(), os.time(), and os.clock(). I dont like tick() because it’s deprecated, os.time() because it uses integer time, and os.clock() because it is cpu time. Any tips/advice on how to measure this?

I use os.clock() all the time and its a great tick() alternative. What the problem with it?, just minus the the two os.clock() to get a very accurate time passed.

1 Like

ah ok, I was just unsure on what it meant by “cpu time”, and if that would be accurate.

VERY VERY accurate, it is used for benchmarking but you can still use it for game.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.