public class Stopwatch extends Object
Constructor and Description |
---|
Stopwatch() |
Modifier and Type | Method and Description |
---|---|
long |
countMillis() |
long |
countNanos() |
boolean |
isLessThan(CalendarDateDuration duration) |
boolean |
isLessThanMillis(long millis) |
boolean |
isLessThanNanos(long nanos) |
boolean |
isMoreThan(CalendarDateDuration duration) |
boolean |
isMoreThanMillis(long millis) |
boolean |
isMoreThanNanos(long nanos) |
static CalendarDateDuration |
meassure(Runnable task)
Meassure task duration using this class' stopwatch functionality.
|
static CalendarDateDuration |
meassure(Runnable task,
CalendarDateUnit unit) |
void |
reset()
Reset the start-instant
|
CalendarDateDuration |
stop()
This method can be called repeatedly without resetting (doesn't actually stop the timing process)
|
CalendarDateDuration |
stop(CalendarDateUnit unit) |
public static CalendarDateDuration meassure(Runnable task)
task
- The task to meassurepublic static CalendarDateDuration meassure(Runnable task, CalendarDateUnit unit)
public long countMillis()
public long countNanos()
public boolean isLessThan(CalendarDateDuration duration)
public boolean isLessThanMillis(long millis)
public boolean isLessThanNanos(long nanos)
public boolean isMoreThan(CalendarDateDuration duration)
public boolean isMoreThanMillis(long millis)
public boolean isMoreThanNanos(long nanos)
public void reset()
public CalendarDateDuration stop()
public CalendarDateDuration stop(CalendarDateUnit unit)
Copyright © 2019 Optimatika. All rights reserved.