Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
Timer |
|
| 2.0;2 |
1 | package org.jbehave.core.steps; | |
2 | ||
3 | 196 | public class Timer { |
4 | private long start; | |
5 | ||
6 | public Timer start() { | |
7 | 196 | start = System.currentTimeMillis(); |
8 | 196 | return this; |
9 | } | |
10 | ||
11 | /** | |
12 | * @return the milliseconds elapsed since the timer was started, or zero if the timer was never started | |
13 | */ | |
14 | public long stop() { | |
15 | 194 | if (start == 0) |
16 | 0 | return 0; |
17 | 193 | return System.currentTimeMillis() - start; |
18 | } | |
19 | } |