This commit is contained in:
sekta
2024-07-31 17:44:25 +04:00
parent bee4421ce9
commit 509db9790d
2 changed files with 19 additions and 36 deletions
+1 -16
View File
@@ -69,21 +69,6 @@ console.add_command(
end
)
local function FormattedTime(seconds, format ) -- from gmod
if not seconds then seconds = 0 end
local hours = math.floor(seconds / 3600)
local minutes = math.floor((seconds / 60) % 60)
local millisecs = (seconds - math.floor(seconds)) * 100
seconds = math.floor(seconds % 60)
if format then
return string.format(format, minutes, seconds, millisecs)
else
return {h = hours, m = minutes, s = seconds, ms = millisecs}
end
end
console.add_command(
"time.uptime",
"Get time elapsed since the engine started",
@@ -91,7 +76,7 @@ console.add_command(
local uptime = time.uptime()
local formatted_uptime = ""
local t = FormattedTime(uptime)
local t = string.formatted_time(uptime)
formatted_uptime = t.h .. "h " .. t.m .. "m " .. t.s .. "s"