Class Clock

java.lang.Object
io.opencensus.common.Clock
Direct Known Subclasses:
MillisClock, TestClock, ZeroTimeClock

public abstract class Clock extends Object
Interface for getting the current time.
Since:
0.5
  • Constructor Details

    • Clock

      public Clock()
  • Method Details

    • now

      public abstract Timestamp now()
      Obtains the current instant from this clock.
      Returns:
      the current instant.
      Since:
      0.5
    • nowNanos

      public abstract long nowNanos()
      Returns a time measurement with nanosecond precision that can only be used to calculate elapsed time.
      Returns:
      a time measurement with nanosecond precision that can only be used to calculate elapsed time.
      Since:
      0.5