Class Ticks
java.lang.Object
com.ultikits.ultitools.scheduling.Ticks
Tick/duration conversions at the nominal 20 ticks per second.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final longstatic final DurationOne tick, 50 ms. -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
TICK
One tick, 50 ms. -
NANOS_PER_TICK
private static final long NANOS_PER_TICK- See Also:
-
-
Constructor Details
-
Ticks
private Ticks()
-
-
Method Details
-
of
Returnsticks * 50 mswithout overflowing an intermediate millisecond count.- Throws:
IllegalArgumentException- if ticks is negative
-
ceil
Returns whole ticks covering the duration, rounded up: zero to 0, 1 ms to 1, 50 ms to 1, and 51 ms to 2.- Throws:
IllegalArgumentException- if the duration is negativeArithmeticException- if the tick count overflows a long
-