diff --git a/src/Stopwatch.rs b/src/Stopwatch.rs index ac2c04b..cea0ea5 100644 --- a/src/Stopwatch.rs +++ b/src/Stopwatch.rs @@ -79,7 +79,11 @@ impl Stopwatch{ } pub fn getString(&self) -> String{ //Get the time in the most granular form possible - let mut duration = self.getNano() as f64; + return Stopwatch::getStr(self.getNano() as f64); + } + //A function to print out the time for any nanosecond duration passed to it + pub fn getStr(nano: f64) -> String{ + let mut duration = nano; let mut timeRes = TimeResolution::NANOSECOND as i32; //Reduce the number until it has the appropriate number of digits. (xxx.xxx) //This loop works down to seconds