public abstract class Ticker extends Object
Stopwatch
instead of
interacting with this class directly.
Warning: this interface can only be used to measure elapsed time, not wall time.
Modifier and Type | Method and Description |
---|---|
abstract long |
read()
Returns the number of nanoseconds elapsed since this ticker's fixed
point of reference.
|
static Ticker |
systemTicker()
A ticker that reads the current time using
System.nanoTime() . |
public static Ticker systemTicker()
System.nanoTime()
.public abstract long read()
Copyright © 2007-2024, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.