Skip to content
Snippets Groups Projects
Commit 92498ecb authored by Christian Wulf's avatar Christian Wulf
Browse files

generalized StopWatch

parent da675420
No related branches found
No related tags found
No related merge requests found
...@@ -35,6 +35,10 @@ public final class StopWatch { ...@@ -35,6 +35,10 @@ public final class StopWatch {
} }
public long getDurationInMs() { public long getDurationInMs() {
return TimeUnit.NANOSECONDS.toMillis(getDurationInNs()); return getDuration(TimeUnit.MILLISECONDS);
}
public long getDuration(final TimeUnit timeUnit) {
return timeUnit.convert(getDurationInNs(), TimeUnit.NANOSECONDS);
} }
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment