Anonymous

Module:TimeSpan: Difference between revisions

From Melvor Idle
Add two extra constructors
(First version)
 
(Add two extra constructors)
Line 36: Line 36:
     setmetatable(self, TimeSpan_mt)
     setmetatable(self, TimeSpan_mt)
     return self
     return self
end
function TimeSpan.FromMilliseconds(milliseconds)
    return TimeSpan.new(0, 0, 0, 0, (milliseconds or 0))
end
function TimeSpan.FromSeconds(seconds)
    local totalMilliseconds = (seconds or 0) * MillisecondsPerSecond
    return TimeSpan.new(0, 0, 0, 0, totalMilliseconds)
end
end


2,875

edits