com.hazelcast.util

## Class Clock

- java.lang.Object
- - com.hazelcast.util.Clock

-     public final class Clock
      extends Object

  Abstracts the system clock to simulate different clocks without changing the actual system time. Can be used to simulate different time zones or to control timing related behavior in Hazelcast. The time offset can be configured with the property . The clock implementation can be configured with the property . WARNING: This class is a singleton. Once the class has been initialized, the clock implementation or offset cannot be changed. To use this class properly in unit or integration tests, please have a look at `ClockIntegrationTest`.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `Clock.ClockImpl` Extend this class if you want to provide your own clock implementation.

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static long` | `currentTimeMillis()` Returns the current time in ms for the configured `Clock.ClockImpl`

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

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

- - ### Method Detail

    - #### currentTimeMillis

          public static long currentTimeMillis()

      Returns the current time in ms for the configured `Clock.ClockImpl`

Copyright © 2020. All rights reserved.