Fixed problem where minute and hour weren't

returning the correct value
This commit is contained in:
2019-03-29 12:34:48 -04:00
parent 492a9dcd36
commit d90f621252

View File

@@ -117,17 +117,7 @@ function Stopwatch:getMinutes()
local timeDifference = self:getTime(); --Get the time that has elapsed local timeDifference = self:getTime(); --Get the time that has elapsed
--If you did not get an error convert the time to minutes --If you did not get an error convert the time to minutes
if(timeDifference >= 0) then if(timeDifference >= 0) then
timerDifference = timeDifference / 60; timeDifference = timeDifference / 60;
end
return timeDifference;
end
--This function returns the duration the stopwatch has run in hours
function Stopwatch:getHours()
local timeDifference = self:getTime(); --Get the time that has elapsed
--If you did not get an error convert the time to minutes
if(timeDifference >= 0) then
timerDifference = timeDifference / 3600;
end end
return timeDifference; return timeDifference;
end end
@@ -142,6 +132,16 @@ function Stopwatch:getMinutes()
return timeDifference; return timeDifference;
end end
--This function returns the duration the stopwatch has run in hours
function Stopwatch:getHours()
local timeDifference = self:getTime(); --Get the time that has elapsed
--If you did not get an error convert the time to minutes
if(timeDifference >= 0) then
timeDifference = timeDifference / 3600;
end
return timeDifference;
end
function Stopwatch:getString() function Stopwatch:getString()
local timeDifference = self:getTime(); --Get the time that has elapsed local timeDifference = self:getTime(); --Get the time that has elapsed
local timeResolution = Stopwatch.timeResolution.seconds; local timeResolution = Stopwatch.timeResolution.seconds;