Does tick() function still work?

Hi,
I know i can check it by trying this on roblox studio but i’m temporarily “computerless” but i need to know because i’m doing community tutorial. I can’t find info about tick() anywhere. Does it got removed?

2 Likes

Yes–tick still exists. No reason for tick to get removed.

tick() still returns the time since EPOCH in the current context’s timezone.

4 Likes

The reason could be os.time() because it’s the same and idk what’s better

os.time()'s context is UTC+0.
tick()'s context is dependent on the system its being ran from.

They do the same thing but os.time() would be used for when you need a time variable that is global across several clients.

os.time() also returns integer seconds. tick() can return fractional seconds. This could be important if you need to do something with checking how long something ran in under a second.

1 Like

I like tick.

Tick + 5 is 5 seconds from now… Nice, reliable Tick…

tick() + 5 and os.time() + 5 represent the same idea. Both statements are 5 seconds from “now”.

i heard its better to use os.time() cause tick() has some problems on specific devices

Except for the fractional seconds. If you are queuing a bunch of 1 second attacks (let’s say 40 players and 40 enemies), It helps if you aren’t calling them all simultaneously.

I only use it on server, and it runs beautifully.

Does it still work?
Yes

Should it ever be used?
No

If you want a centralized time, then use os.time()
Other than that, os.clock() is just like tick but, well, better
It provides more decimal points for better precision and is really good with benchmarking. Again, os.clock does not return a centralized time, but os.time does.

1 Like

Wait… You mean os.time()? You wrote os.clock()

Just because it runs beautifully doesn’t mean you should use it. It is now deprecated, read my post above and please stop trying to convince OP poster that tick is good.

Read this post here:

I meant os.clock, it is like tick but with more precision. os.time should be used when making sure you use a centralized time.

No no, why is this marked as solution. Don’t use tick.

It’s marked as solution because it answers the original question lol

2 Likes

Yes, but tick should never be used. The OP poster will now be using tick when they shouldn’t.

Also

os.clock does this but with even more precision.

Yes you are right but i want to make a tutorial about Unix time

Don’t get me wrong, you’re right. Personally, I don’t use tick() anymore either. I do what the Roblox staff recommended in the DevForum post.

  • If you need a UNIX timestamp, you should use os.time() .
  • If you need to measure performance (benchmarking), use os.clock().
  • For everything else, use time().

But it’s marked as solution because the original question was whether tick() still works. Not if tick() should be used or not. It’d be weird to see the solution to a question being different from the true question.

1 Like

Does your audience even know what a UNIX timestamp is? Are they trying to measure performance?

So, if you need a UNIX timestamp, you should use os.time() . You get a stable baseline (from 1970’s) and 1s resolution. If you need to measure performance, you should use os.clock() . You don’t get a stable baseline, but you get ~1us resolution. If you need to do anything else, you should probably use time() .

I mean, it’s great you are trying to sell a new car, but I was walking next door… Yesterday. Tick did the job flawlessly, and no one was there to stop me from witnessing it.

Here’s some Roblox details on Tick for the OP. Not depreciated yet, but maybe in the future when one second of UNIX time spells disaster.

Roblox Globals

You are correct it is not deprecated, but there are reliability issues with tick that aren’t present.

Read this post made by Roblox staff listing the problems with tick and a couple old time functions:

Just because tick works in most situations okay, is it really that hard to just replace it all with os.clock or some other time function that are backed by Roblox staff?

Also I get what you are trying to say with the whole car thing (although it made very little sense and seemed irrelevant), I see no reason to see “yesterday” tick working. There is literally no reason to use tick anymore. Zero.

The tutorial: