Class MillisClock

java.lang.Object
io.opencensus.common.Clock
io.opencensus.implcore.common.MillisClock

@ThreadSafe public final class MillisClock extends Clock
  • Field Details

  • Constructor Details

    • MillisClock

      private MillisClock()
  • Method Details

    • getInstance

      public static MillisClock getInstance()
      Returns a MillisClock.
      Returns:
      a MillisClock.
    • now

      public Timestamp now()
      Description copied from class: Clock
      Obtains the current instant from this clock.
      Specified by:
      now in class Clock
      Returns:
      the current instant.
    • nowNanos

      public long nowNanos()
      Description copied from class: Clock
      Returns a time measurement with nanosecond precision that can only be used to calculate elapsed time.
      Specified by:
      nowNanos in class Clock
      Returns:
      a time measurement with nanosecond precision that can only be used to calculate elapsed time.