MCPcopy Create free account
hub / github.com/apache/kafka / SystemTime

Class SystemTime

clients/src/main/java/org/apache/kafka/common/utils/SystemTime.java:22–43  ·  view source on GitHub ↗

A time implementation that uses the system clock and sleep call

Source from the content-addressed store, hash-verified

20 * A time implementation that uses the system clock and sleep call
21 */
22public 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}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected