How does tick() calculate time passed in game?

I get that it gives you the number of seconds since january 1st 1970, but how does that give you the time passed in game? I’ve seen people used to tick to subtract from another value to get the time passed but how does all that work?

If you store a variable when the game starts then you can measure the time since the game started in seconds. It is some simple math.

If you start doing something at 5 PM and you check the time and it is currently 8PM that means you have been doing the thing for 3 hours. 8 - 5 = 3. Abstract this idea a bit more and you will lead to the solution: Difference = Now - Start

Code example using tick().

local Start = tick()

wait(5) --// simulate doing something for example
local Difference = tick() - Start

Ah okaaay, that clears it up. Thanks