Package me.autobot.lib.math
Class Clock
java.lang.Object
me.autobot.lib.math.Clock
Used to keep track of time.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
elapsed
(long time) Check if the given time has elapsed.boolean
elapsedSince
(long time) Check if the given time has elapsed since the last time it was triggered.long
Check how long it has been since the clock was created.void
setPaused
(boolean paused) Sets if the timer is paused.
-
Constructor Details
-
Clock
public Clock()Creates a new clock object.
-
-
Method Details
-
getTimeElapsed
public long getTimeElapsed()Check how long it has been since the clock was created.- Returns:
- The time elapsed in milliseconds.
-
elapsed
public boolean elapsed(long time) Check if the given time has elapsed.- Parameters:
time
- The time to check.- Returns:
- Whether the time has elapsed.
-
elapsedSince
public boolean elapsedSince(long time) Check if the given time has elapsed since the last time it was triggered.- Parameters:
time
- The time to check.- Returns:
- Whether the time has elapsed.
-
setPaused
public void setPaused(boolean paused) Sets if the timer is paused.- Parameters:
paused
- Whether the timer is paused.
-