mirror of
https://bitbucket.org/Mattrixwv/luaclasses.git
synced 2025-12-06 18:33:59 -05:00
Fixed problem where minute and hour weren't
returning the correct value
This commit is contained in:
@@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user