Class MSTimer
java.lang.Object
de.florianmichael.rclasses.math.integration.MSTimer
A simple timer class.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlonggetDelta()longgetTime()booleanhasReached(long delay) booleanhasReached(long delay, boolean reset) voidpause()Pauses the timer.voidreset()Resets the timer.voidresume()Resumes the timer.voidsetTime(long time)
-
Constructor Details
-
MSTimer
public MSTimer()
-
-
Method Details
-
pause
public void pause()Pauses the timer. -
resume
public void resume()Resumes the timer. -
reset
public void reset()Resets the timer. -
hasReached
public boolean hasReached(long delay) - Parameters:
delay- The delay to check.- Returns:
- Whether the timer has reached the given delay.
-
hasReached
public boolean hasReached(long delay, boolean reset) - Parameters:
delay- The delay to check.reset- Whether the timer should be reset after the check.- Returns:
- Whether the timer has reached the given delay.
-
getDelta
public long getDelta()- Returns:
- The delta time in milliseconds.
-
getTime
public long getTime()- Returns:
- The time in milliseconds. If the timer is paused, the paused time is returned.
-
setTime
public void setTime(long time)
-