public class Times extends Object
Modifier and Type | Method and Description |
---|---|
static long |
get(Time time,
TimeUnit timeUnit)
Convenience method to measure time in a given TimeUnit.
|
static long |
getDiff(Time time,
TimeUnit timeUnit,
long startTime)
Convenience method to get time since the beginning of an event in a given
TimeUnit.
|
static long |
getMicrosSince(Time time,
long previousMicros)
Convenience method to get microseconds since a previous microseconds point.
|
static long |
getMillisecondsSince(Time time,
long previousMilliseconds)
Convenience method to get milliseconds since a previous milliseconds
point.
|
static long |
getMsSince(Time time,
long previousMs)
Convenience method to get milliseconds since a previous milliseconds
point.
|
static long |
getNanosecondsSince(Time time,
long previousNanoseconds)
Convenience method to get nanoseconds since a previous nanoseconds
point.
|
static long |
getNanosSince(Time time,
long previousNanos)
Convenience method to get nanoseconds since a previous nanoseconds
point.
|
static int |
getSecondsSince(Time time,
int previousSeconds)
Convenience method to get seconds since a previous seconds
point.
|
static int |
getSecSince(Time time,
int previousSec)
Convenience method to get seconds since a previous seconds
point.
|
public static long get(Time time, TimeUnit timeUnit)
time
- Time instance to usetimeUnit
- TimeUnit to measure inpublic static long getDiff(Time time, TimeUnit timeUnit, long startTime)
time
- Time object used for measuring.timeUnit
- TimeUnit to use for dimension.startTime
- beginning time to diff againstpublic static long getMillisecondsSince(Time time, long previousMilliseconds)
time
- Time instance to usepreviousMilliseconds
- Previous millisecondspublic static long getMsSince(Time time, long previousMs)
time
- Time instance to usepreviousMs
- Previous millisecondspublic static long getMicrosSince(Time time, long previousMicros)
time
- Time instance to usepreviousMicros
- Previous microsecondspublic static long getNanosecondsSince(Time time, long previousNanoseconds)
time
- Time instance to usepreviousNanoseconds
- Previous nanosecondspublic static long getNanosSince(Time time, long previousNanos)
time
- Time instance to usepreviousNanos
- Previous nanosecondspublic static int getSecondsSince(Time time, int previousSeconds)
time
- Time instance to usepreviousSeconds
- Previous secondspublic static int getSecSince(Time time, int previousSec)
time
- Time instance to usepreviousSec
- Previous secondsCopyright © 2011-2020 The Apache Software Foundation. All Rights Reserved.