public final class Timers extends Object
ElapsedTimeResult
for use with other tasks that might have time-dependent
behavior.Modifier and Type | Method and Description |
---|---|
static Task |
fixedDelta(double dt)
Create a new Task that reports an
ElapsedTimeResult with the provided fixed
time delta. |
static Task |
measuredDelta()
Create a new Task that reports an
ElapsedTimeResult with the elapsed time
since the start of the task's last invocation. |
public static Task fixedDelta(double dt)
ElapsedTimeResult
with the provided fixed
time delta. It is generally recommended for this task to be one of the first to
execute within a job.
The created task always reports the fixed time delta, regardless of true elapsed
time between invocations, and performs no other action.dt
- The fixed time delta to always reportIllegalArgumentException
- if dt is less than or equal to zeropublic static Task measuredDelta()
ElapsedTimeResult
with the elapsed time
since the start of the task's last invocation. It is generally recommended for this
task to be one of the first to execute within a job.
The created task always reports the measured elapsed time and performs no other
action.Copyright © 2013. All Rights Reserved.