diff --git a/Stopwatch.py b/Stopwatch.py index 81d733d..c1b9a57 100644 --- a/Stopwatch.py +++ b/Stopwatch.py @@ -42,21 +42,9 @@ class Stopwatch: return -1 #Return a specific resolution of time. This is done as a floating point number - #Returns the result of getTime() in terms of seconds - def getSeconds(self): - second = self.getTime() - if(second < 0): - return second - else: - return (second / 1000000000) - - #Returns the result of getTime() in terms of milliseconds - def getMilliseconds(self): - milli = self.getTime() - if(milli < 0): - return milli - else: - return (milli / 1000000) + #Returns the result of getTime() in terms of nanoseconds + def getNanoseconds(self): + return self.getTime() #Returns the result of getTime() in terms of microseconds def getMicroseconds(self): @@ -66,6 +54,25 @@ class Stopwatch: else: return (micro / 1000) - #Returns the result of getTime() in terms of nanoseconds - def getNanoseconds(self): - return self.getTime() + #Returns the result of getTime() in terms of milliseconds + def getMilliseconds(self): + milli = self.getTime() + if(milli < 0): + return milli + else: + return (milli / 1000000) + #Returns the result of getTime() in terms of seconds + def getSeconds(self): + second = self.getTime() + if(second < 0): + return second + else: + return (second / 1000000000) + + #Returns the result of getTime() in terms of minutes + def getMinutes(self): + minute = self.getTime() + if(minute < 0): + return minute + else: + return (minute / 60000000000)