Back to Fresco

AwakeTimeSinceBootClock

docs/javadoc/reference/com/facebook/common/time/AwakeTimeSinceBootClock.html

3.6.012.8 KB
Original Source

Fresco

|

|

Packages | Classes

Interfaces

Classes

Packages | Classes

Summary: Methods | Inherited Methods | [Expand All]

public class

AwakeTimeSinceBootClock

extends Object
implements MonotonicClockMonotonicNanoClock

| java.lang.Object | | ↳ | com.facebook.common.time.AwakeTimeSinceBootClock |

Class Overview

A clock that returns number of milliseconds since boot. It guarantees that every next call to now() will return a value that is not less that was returned from previous call to now(). This happens regardless system time changes, time zone changes, daylight saving changes etc.

DO USE THIS CLOCK FOR PERFORMANCE MEASUREMENT. IT STOPS TICKING WHILE THE DEVICE SLEEPS, THAT IS, WHILE THE DEVICE CANNOT RUN THE CODE WE ARE PURPORTEDLY MEASURING.

Summary

Public Methods
static AwakeTimeSinceBootClock
Returns a singleton instance of this clock.
long
Produce a timestamp.
long
Produce a timestamp.

| [Expand] Inherited Methods | | --- | | From class java.lang.Object

| Object | clone() | | boolean | equals(Object arg0) | | void | finalize() | | final Class<?> | getClass() | | int | hashCode() | | final void | notify() | | final void | notifyAll() | | String | toString() | | final void | wait(long arg0, int arg1) | | final void | wait(long arg0) | | final void | wait() |

| | From interface com.facebook.common.time.MonotonicClock

| abstract long | now() Produce a timestamp. |

| | From interface com.facebook.common.time.MonotonicNanoClock

| abstract long | nowNanos() Produce a timestamp. |

|

Public Methods

public static AwakeTimeSinceBootClock get()

Returns a singleton instance of this clock.

Returns
  • singleton instance

public long now()

Produce a timestamp. Values returned from this method may only be compared to other values returned from this clock in this process. They have no meaning outside of this process and should not be written to disk.

The difference between two timestamps is an interval, in milliseconds.

Returns
  • A timestamp for the current time, in ms.

public long nowNanos()

Produce a timestamp. Values returned from this method may only be compared to other values returned from this clock in this process. They have no meaning outside of this process and should not be written to disk.

The difference between two timestamps is an interval, in nanoseconds.

Returns
  • A timestamp for the current time, in nanoseconds.

+Generated by Doclava. +