public final class Ticks extends Object
| Modifier and Type | Field and Description |
|---|---|
static int |
MILLISECONDS_PER_SECOND |
static int |
MILLISECONDS_PER_TICK |
static int |
TICKS_PER_SECOND |
| Modifier and Type | Method and Description |
|---|---|
static long |
from(long duration,
TimeUnit unit)
Converts a duration in a certain unit of time to ticks.
|
static long |
to(long ticks,
TimeUnit unit)
Converts ticks to a duration in a certain unit of time.
|
public static final int TICKS_PER_SECOND
public static final int MILLISECONDS_PER_SECOND
public static final int MILLISECONDS_PER_TICK
public static long from(long duration,
@Nonnull
TimeUnit unit)
Ticks.from(duration) returns the number of ticks from the given duration.
duration - the duration of timeunit - the unit the duration is inpublic static long to(long ticks,
@Nonnull
TimeUnit unit)
Ticks.to(ticks) converts the number of ticks to a duration.
ticks - the number of ticksunit - the unit to return the duration inCopyright © 2022. All rights reserved.