Package arc.util

Class Time

java.lang.Object
arc.util.Time

public class Time extends Object
  • Field Details

    • toSeconds

      public static final float toSeconds
      Conversion factors for ticks to other unit values.
      See Also:
    • toMinutes

      public static final float toMinutes
      Conversion factors for ticks to other unit values.
      See Also:
    • toHours

      public static final float toHours
      Conversion factors for ticks to other unit values.
      See Also:
    • delta

      public static float delta
      Global delta value. Do not change.
    • time

      public static float time
      Global time values. Do not change.
    • globalTime

      public static float globalTime
      Global time values. Do not change.
    • millisPerSecond

      public static final long millisPerSecond
      See Also:
    • nanosPerMilli

      public static final long nanosPerMilli
      See Also:
    • nanosPerSecond

      public static final long nanosPerSecond
      See Also:
  • Constructor Details

    • Time

      public Time()
  • Method Details

    • getRuns

      public static Seq<Time.DelayRun> getRuns()
    • setRuns

      public static void setRuns(Seq<Time.DelayRun> runs)
    • run

      public static void run(float delay, Runnable r)
      Runs a task with a delay of several ticks. If Time.clear() is called, this task will be cancelled.
    • runTask

      public static Timer.Task runTask(float delay, Runnable r)
      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()
    • getInternalTime

      public static double getInternalTime()
    • setInternalTime

      public static void setInternalTime(double timeInternal)
    • clear

      public static void clear()
    • setDeltaProvider

      public static void setDeltaProvider(Floatp impl)
    • nanos

      public static long nanos()
      Returns:
      The current value of the system timer, in nanoseconds.
    • nanosMillis

      public static long nanosMillis()
      Returns:
      The current value of the system timer, in milliseconds.
    • 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
    • millisSinceNanos

      public static long millisSinceNanos(long prevTime)
      Get the time in nanos passed since a previous time
      Parameters:
      prevTime - must be nanoseconds
      Returns:
      time passed since prevTime in milliseconds
    • 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