2,875
edits
(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 | ||
edits