org.apache.cassandra.utils

## Class Clock

- java.lang.Object
- - org.apache.cassandra.utils.Clock

-     public class Clock
      extends java.lang.Object

  Wrapper around time related functions that are either implemented by using the default JVM calls or by using a custom implementation for testing purposes. See `instance` for how to use a custom implementation. Please note that `Clock` wasn't used, as it would not be possible to provide an implementation for `nanoTime()` with the exact same properties of `System.nanoTime()`.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static Clock` | `instance` Static singleton object that will be instanciated by default with a system clock implementation.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `Clock()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `long` | `currentTimeMillis()`
    `long` | `nanoTime()`

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

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

- - ### Field Detail

    - #### instance

          public static Clock instance

      Static singleton object that will be instanciated by default with a system clock implementation. Set `cassandra.clock` system property to a FQCN to use a different implementation instead.

  - ### Constructor Detail

    - #### Clock

          public Clock()

  - ### Method Detail

    - #### nanoTime

          public long nanoTime()

      See Also:
        `System.nanoTime()`

    - #### currentTimeMillis

          public long currentTimeMillis()

      See Also:
        `System.currentTimeMillis()`

Copyright © 2018 The Apache Software Foundation