Time (Apache ZooKeeper - Server 3.7.0 API)
Date: 2021-03-17

org.apache.zookeeper.common

## Class Time

- java.lang.Object
- - org.apache.zookeeper.common.Time

-     public class Time
      extends Object

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `Time()`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static long` | `currentElapsedTime()` Returns time in milliseconds as does System.currentTimeMillis(), but uses elapsed time from an arbitrary epoch more like System.nanoTime().
    `static long` | `currentWallTime()` Explicitly returns system dependent current wall time.
    `static Date` | `elapsedTimeToDate(long elapsedTime)` This is to convert the elapsedTime to a Date.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### Time

          public Time()

  - ### Method Detail

    - #### currentElapsedTime

          public static long currentElapsedTime()

      Returns time in milliseconds as does System.currentTimeMillis(), but uses elapsed time from an arbitrary epoch more like System.nanoTime(). The difference is that if somebody changes the system clock, Time.currentElapsedTime will change but nanoTime won't. On the other hand, all of ZK assumes that time is measured in milliseconds.
      Returns:
        The time in milliseconds from some arbitrary point in time.

    - #### currentWallTime

          public static long currentWallTime()

      Explicitly returns system dependent current wall time.
      Returns:
        Current time in msec.

    - #### elapsedTimeToDate

          public static Date elapsedTimeToDate(long elapsedTime)

      This is to convert the elapsedTime to a Date.
      Returns:
        A date object indicated by the elapsedTime.

Copyright © 2008–2021 The Apache Software Foundation. All rights reserved.