harleydude
November 6th, 2008, 09:21 PM
Found part of this somewhere on the board. Modified it some to make it more user friendly.
local seconds = win.GetElapsedSeconds ()
local hour = string.format("%02.f", math.floor(seconds / 3600))
local min = string.format("%02.f", math.floor(seconds / 60 - (hour * 60)))
local sec = string.format("%02.f", math.floor(seconds - hour * 3600 - min * 60))
local uptime = string.format('Girder has been running for %d hours %d minutes and %d seconds', hour, min, sec)
print (uptime)
Will display something similar to: Girder has been running for 0 hours 9 minutes and 36 seconds
local seconds = win.GetElapsedSeconds ()
local hour = string.format("%02.f", math.floor(seconds / 3600))
local min = string.format("%02.f", math.floor(seconds / 60 - (hour * 60)))
local sec = string.format("%02.f", math.floor(seconds - hour * 3600 - min * 60))
local uptime = string.format('Girder has been running for %d hours %d minutes and %d seconds', hour, min, sec)
print (uptime)
Will display something similar to: Girder has been running for 0 hours 9 minutes and 36 seconds