mirror of
https://bitbucket.org/Mattrixwv/luaclasses.git
synced 2025-12-06 18:33:59 -05:00
Fixed bug when calling getString without
first calling stop
This commit is contained in:
@@ -77,7 +77,7 @@ function Stopwatch:getTime()
|
||||
timeDifference = self.stopTime - self.startTime;
|
||||
--If start has been called but stop hasn't make the current time the end time. This simulates looking at a stopwatch while it is still running
|
||||
elseif((self.startTime ~= nil) and (self.stopTime == nil)) then
|
||||
timeDifference = os.time() - self.startTime;
|
||||
timeDifference = os.clock() - self.startTime;
|
||||
--Otherwise return -1 as an error
|
||||
else
|
||||
timeDifference = -1;
|
||||
@@ -183,7 +183,7 @@ function Stopwatch:getString()
|
||||
elseif(timeResoltuion == Stopwatch.timeResolution.hours) then
|
||||
timeString = string.format("%.3f hours", timeDifference);
|
||||
else
|
||||
timeString = "ERROR!";
|
||||
timeString = "ERROR! TimeResolution = " .. timeResolution;
|
||||
end
|
||||
|
||||
--Return the string
|
||||
|
||||
Reference in New Issue
Block a user