Files
Techmino/Zframework/toTime.lua
2021-02-13 04:11:49 +08:00

11 lines
250 B
Lua

local int,format=math.floor,string.format
function toTime(s)
if s<60 then
return format("%.3fs",s)
elseif s<3600 then
return format("%d:%.2f",int(s/60),s%60)
else
local h=int(s/3600)
return format("%d:%d:%.2f",h,int(s/60%60),s%60)
end
end