public final class Statistics extends Statistics
Modifier and Type | Field and Description |
---|---|
private PerfEvent[] |
perfEvents |
Constructor and Description |
---|
Statistics() |
Modifier and Type | Method and Description |
---|---|
long |
cycles()
Read a cycle counter (high resolution, non-monotonic clock).
|
long |
millisToNanos(double t)
Converts milliseconds to nanoseconds
|
double |
nanosToMillis(long c)
Converts nanoseconds to milliseconds
|
double |
nanosToSecs(long c)
Converts nanoseconds to seconds
|
long |
nanoTime()
Read nanoTime (high resolution, monotonically increasing clock).
|
void |
perfEventInit(String events)
Initializes performance events.
|
void |
perfEventRead(int id,
long[] values)
Reads a performance event value.
|
long |
secsToNanos(double t)
Convert seconds to nanoseconds
|
private PerfEvent[] perfEvents
public Statistics()
public long nanoTime()
nanoTime
in class Statistics
public long cycles()
cycles
in class Statistics
public double nanosToMillis(long c)
Statistics
nanosToMillis
in class Statistics
c
- time in nanosecondspublic double nanosToSecs(long c)
Statistics
nanosToSecs
in class Statistics
c
- time in nanosecondspublic long millisToNanos(double t)
Statistics
millisToNanos
in class Statistics
t
- time in millisecondspublic long secsToNanos(double t)
Statistics
secsToNanos
in class Statistics
t
- time in secondspublic void perfEventInit(String events)
Statistics
perfEventInit
in class Statistics
events
- the events to initialize. This is a comma-separated
list of event names.public void perfEventRead(int id, long[] values)
Statistics
perfEventRead
in class Statistics
id
- the event's idvalues
- a buffer that will hold the return values of the
read (3 64-bit values).