Pauser.SleepyWarningMIN_PROCESSORS, SLEEPY| Constructor and Description |
|---|
MilliPauser(long pauseTimeMS)
first it will busy wait, then it will yield, then sleep for a small amount of time, then
increases to a large amount of time.
|
| Modifier and Type | Method and Description |
|---|---|
long |
countPaused()
Returns the number of times the pauser has checked for
completion.
|
MilliPauser |
minPauseTimeMS(long pauseTimeMS) |
void |
pause()
Pauses the current thread.
|
long |
pauseTimeMS() |
MilliPauser |
pauseTimeMS(long pauseTimeMS) |
void |
reset()
Resets the pauser's internal state back to the most aggressive setting.
|
long |
timePaused()
Returns the paused time so far in milliseconds.
|
void |
unpause()
Try to cancel the pausing if it is pausing.
|
public MilliPauser(long pauseTimeMS)
pauseTimeMS - the pause time for each loop.public MilliPauser pauseTimeMS(long pauseTimeMS)
public MilliPauser minPauseTimeMS(long pauseTimeMS)
public long pauseTimeMS()
public void reset()
PauserCall this if you just did some work.
public void pause()
PauserDepending on the implementation this could do nothing (busy spin), yield, sleep, ...
Call this if no work was done.
public void unpause()
PauserNo guarantee is made as to if unpause will actually have an effect.
public long timePaused()
PausertimePaused in interface Pauserpublic long countPaused()
PausercountPaused in interface PauserCopyright © 2020. All rights reserved.