MCPcopy Create free account
hub / github.com/grpc/grpc-java / FakeTicker

Class FakeTicker

api/src/test/java/io/grpc/DeadlineTest.java:328–351  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

326 }
327
328 private static class FakeTicker extends Deadline.Ticker {
329 private long time;
330
331 @Override
332 public long nanoTime() {
333 return time;
334 }
335
336 public void reset(long time) {
337 this.time = time;
338 }
339
340 public void increment(long period, TimeUnit unit) {
341 if (period < 0) {
342 throw new IllegalArgumentException();
343 }
344 this.time += unit.toNanos(period);
345 }
346
347 @Override
348 public String toString() {
349 return "FAKE_TICKER";
350 }
351 }
352}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected