Package org.rspeer.commons
Class StopWatch
- java.lang.Object
-
- org.rspeer.commons.StopWatch
-
public class StopWatch extends Object
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
exceeds(Duration duration)
static StopWatch
fixed(Duration duration)
static StopWatch
fixed(Supplier<Instant> start, Duration duration)
Duration
getElapsed()
double
getHourlyRate(long value)
double
getRate(long value, Duration rate)
Duration
getRemaining()
boolean
isPaused()
boolean
isRunning()
void
pause()
void
reset()
void
resume()
void
setEndIn(Duration duration)
static StopWatch
start()
static StopWatch
start(Supplier<Instant> start)
String
toElapsedString()
String
toRemainingString()
String
toString()
-
-
-
Method Detail
-
start
public static StopWatch start()
-
exceeds
public boolean exceeds(Duration duration)
-
setEndIn
public void setEndIn(Duration duration)
-
isPaused
public boolean isPaused()
-
isRunning
public boolean isRunning()
-
getElapsed
public Duration getElapsed()
-
getRemaining
public Duration getRemaining()
-
toElapsedString
public String toElapsedString()
-
toRemainingString
public String toRemainingString()
-
reset
public void reset()
-
pause
public void pause()
-
resume
public void resume()
-
getRate
public double getRate(long value, Duration rate)
-
getHourlyRate
public double getHourlyRate(long value)
-
-