I have heard that tick() is being deprecated sooner or later, so I have tried avoiding using it. I am now in a situation where I need an alternative to tick() and I have no idea on what to use.
I have tried: os.time() - No decimal os.clock() - Not based on UNIX epoch and also not efficient
So, what is an alternative to tick() that functions in the same way but will not be deprecated? (I am fine with creating my own function if I have to, I would just like to know how)
You would be looking at os.clock() for something similar, essentially functions the same way (at least in what its mostly used for in math) but its more precise, and based on the CPU time.
os.time() would the closest to tick(), but without decimals, and based on UTC time, rather than Device local time like tick().
Those are the MAIN alternatives you can use.
You can also use DataTime.now() for decimals, however its not as precise as others, only going to the thousandths place.
From my understanding, it’s a “more accurate” version of tick(), or better said: a better version of it. If you need even more decimals you can use workspace:GetServerTimeNow().
No idea why they all give slightly different numbers unfortunately, but I assume they’re a replacement for tick() for the reasons given in the thread you linked.
workspace:GetServerTimeNow() and DateTime.now().UnixTimestampMillis / 1000 both sound great, thanks! I believe they return a different result than tick() because tick is based on your current timezone. Is there any way to adjust these values to my timezone? (Or whoever is playing’s timezone), if not that is fine, at least they return decimals and are similar to tick.