Package arc.util
Class Time
java.lang.Object
arc.util.Time
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionstatic float
Global delta value.static float
Global time values.static final long
static float
Global time values.static final float
Conversion factors for ticks to other unit values.static final float
Conversion factors for ticks to other unit values.static final float
Conversion factors for ticks to other unit values. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
clear()
static float
elapsed()
A value of -1 means mark() wasn't called beforehand.static void
mark()
static long
millis()
static long
millisToNanos
(long millis) Convert milliseconds time to nanosecondsstatic long
nanos()
static long
nanosToMillis
(long nanos) Convert nanoseconds time to millisecondsstatic void
Runs a task with a delay of several ticks.static Timer.Task
Runs a task with a delay of several ticks.static void
setDeltaProvider
(Floatp impl) static long
timeSinceMillis
(long prevTime) Get the time in millis passed since a previous timestatic long
timeSinceNanos
(long prevTime) Get the time in nanos passed since a previous timestatic void
update()
Use normal delta time (e.static void
-
Field Details
-
toSeconds
public static final float toSecondsConversion factors for ticks to other unit values.- See Also:
-
toMinutes
public static final float toMinutesConversion factors for ticks to other unit values.- See Also:
-
toHours
public static final float toHoursConversion factors for ticks to other unit values.- See Also:
-
delta
public static float deltaGlobal delta value. Do not change. -
time
public static float timeGlobal time values. Do not change. -
globalTime
public static float globalTimeGlobal time values. Do not change. -
nanosPerMilli
public static final long nanosPerMilli- See Also:
-
-
Constructor Details
-
Time
public Time()
-
-
Method Details
-
run
Runs a task with a delay of several ticks. If Time.clear() is called, this task will be cancelled. -
runTask
Runs a task with a delay of several ticks. Unless the application is closed, this task will always complete. -
mark
public static void mark() -
elapsed
public static float elapsed()A value of -1 means mark() wasn't called beforehand. -
updateGlobal
public static void updateGlobal() -
update
public static void update()Use normal delta time (e. g. delta * 60) -
clear
public static void clear() -
setDeltaProvider
-
nanos
public static long nanos()- Returns:
- The current value of the system timer, in nanoseconds.
-
millis
public static long millis()- Returns:
- the difference, measured in milliseconds, between the current time and midnight, January 1, 1970 UTC.
-
nanosToMillis
public static long nanosToMillis(long nanos) Convert nanoseconds time to milliseconds- Parameters:
nanos
- must be nanoseconds- Returns:
- time value in milliseconds
-
millisToNanos
public static long millisToNanos(long millis) Convert milliseconds time to nanoseconds- Parameters:
millis
- must be milliseconds- Returns:
- time value in nanoseconds
-
timeSinceNanos
public static long timeSinceNanos(long prevTime) Get the time in nanos passed since a previous time- Parameters:
prevTime
- - must be nanoseconds- Returns:
- - time passed since prevTime in nanoseconds
-
timeSinceMillis
public static long timeSinceMillis(long prevTime) Get the time in millis passed since a previous time- Parameters:
prevTime
- - must be milliseconds- Returns:
- - time passed since prevTime in milliseconds
-