Skip to content
Snippets Groups Projects
Commit 0be90202 authored by Vojtech Moravec's avatar Vojtech Moravec
Browse files

Fixed error in toString method of stopwatch

parent 2c5fcbc5
No related branches found
No related tags found
No related merge requests found
......@@ -26,6 +26,12 @@
<artifactId>commons-math3</artifactId>
<version>3.6.1</version>
</dependency>
<dependency>
<groupId>org.jetbrains</groupId>
<artifactId>annotations</artifactId>
<version>RELEASE</version>
<scope>compile</scope>
</dependency>
</dependencies>
......
......@@ -39,6 +39,9 @@ public class Stopwatch {
}
public String getElapsedTimeString() {
if (elapsed == null) {
return "No time measured yet.";
}
return String.format("%dH %dMin %d Sec %d Ms", elapsed.toHoursPart(), elapsed.toMinutesPart(), elapsed.toSecondsPart(), elapsed.toMillisPart());
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment