diff --git a/Stopwatch.lua b/Stopwatch.lua index 9f3c5c9..cbe28c9 100644 --- a/Stopwatch.lua +++ b/Stopwatch.lua @@ -117,17 +117,7 @@ function Stopwatch:getMinutes() 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 / 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; + timeDifference = timeDifference / 60; end return timeDifference; end @@ -142,6 +132,16 @@ function Stopwatch:getMinutes() 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 + timeDifference = timeDifference / 3600; + end + return timeDifference; +end + function Stopwatch:getString() local timeDifference = self:getTime(); --Get the time that has elapsed local timeResolution = Stopwatch.timeResolution.seconds;