diff --git a/Stopwatch.lua b/Stopwatch.lua index 78ee332..3c6345b 100644 --- a/Stopwatch.lua +++ b/Stopwatch.lua @@ -1,7 +1,7 @@ --luaClasses/Stopwatch.lua --Matthew Ellison --- Created: 2-1-19 ---Modified: 2-1-19 +-- Created: 02-01-19 +--Modified: 02-06-19 --This is a simple class to be used to time runtimes of various things within programs Stopwatch = { @@ -34,8 +34,12 @@ function Stopwatch:getTime() return (self.stopTime - self.startTime) end +function Stopwatch:getMicroseconds() + return math.floor(self:getTime() * 1000000) +end + function Stopwatch:getMilliseconds() - return math.floor((self:getTime() * 1000)) + return (self:getTime() * 1000) end function Stopwatch:getSeconds()