YAACC - UPNP Client and Server
Loading...
Searching...
No Matches
de.yaacc.multiroom.engine.MicroClock Interface Reference

The client's clock in microseconds. More...

Inheritance diagram for de.yaacc.multiroom.engine.MicroClock:
Inheritance graph
Collaboration diagram for de.yaacc.multiroom.engine.MicroClock:
Collaboration graph

Classes

class  Monotonic
 The clock on a source of nanoseconds. More...
 

Public Member Functions

long nowMicros ()
 

Static Public Member Functions

static MicroClock monotonic ()
 The real clock: System.nanoTime() counted from the first use of this class, so the seconds of a timestamp always fit into the 32 bits of the protocol (a raw nanoTime has an arbitrary origin).
 
static MicroClock fromNanoSource (java.util.function.LongSupplier nanos)
 A clock on any source of nanoseconds that never goes back (the source of a test, or Android's SystemClock.elapsedRealtimeNanos(), which keeps counting while the device sleeps).
 

Detailed Description

The client's clock in microseconds.

It never goes back and has no meaning of its own (the time sync measures the server clock against it), so tests inject a clock they move by hand.

Member Function Documentation

◆ fromNanoSource()

static MicroClock de.yaacc.multiroom.engine.MicroClock.fromNanoSource ( java.util.function.LongSupplier nanos)
static

A clock on any source of nanoseconds that never goes back (the source of a test, or Android's SystemClock.elapsedRealtimeNanos(), which keeps counting while the device sleeps).

Time is counted from the moment of the call.

◆ monotonic()

static MicroClock de.yaacc.multiroom.engine.MicroClock.monotonic ( )
static

The real clock: System.nanoTime() counted from the first use of this class, so the seconds of a timestamp always fit into the 32 bits of the protocol (a raw nanoTime has an arbitrary origin).

On Android that source does not run while the CPU sleeps; the audio engine builds its clock with fromNanoSource and SystemClock.elapsedRealtimeNanos() instead (Group 8).

Referenced by de.yaacc.snapcast.protocol.SnapcastConnection.SnapcastConnection().

Here is the caller graph for this function:

The documentation for this interface was generated from the following file: