Os.Time difference problem

Hello. Recently i’ve been making a system which requires Os.Time to start when a certain event lasts.

local StarTime = os.Time() -- starts the Time


local function DoSomething()
local EndTime = os.Time() -- Starts another one
print("StartTime - EndTime") -- This will count once the function is called.
end

Now, the problem is i need this “Calculation” between these os.Time to return as a decimal, because i get an intager, so for example if i get this:

2

I want this:

2.535353

Thanks in advance!

you can try using tick() to get time as a decimal

1 Like

Thanks! that was actually easy, lol.

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