A time implementation that uses the system clock and sleep call
| 20 | * A time implementation that uses the system clock and sleep call |
| 21 | */ |
| 22 | public class SystemTime implements Time { |
| 23 | |
| 24 | @Override |
| 25 | public long milliseconds() { |
| 26 | return System.currentTimeMillis(); |
| 27 | } |
| 28 | |
| 29 | @Override |
| 30 | public long nanoseconds() { |
| 31 | return System.nanoTime(); |
| 32 | } |
| 33 | |
| 34 | @Override |
| 35 | public void sleep(long ms) { |
| 36 | try { |
| 37 | Thread.sleep(ms); |
| 38 | } catch (InterruptedException e) { |
| 39 | // no stress |
| 40 | } |
| 41 | } |
| 42 | |
| 43 | } |
nothing calls this directly
no outgoing calls
no test coverage detected