public class X_Time extends Object
| Modifier and Type | Method and Description |
|---|---|
static double |
birth() |
static Moment |
clone(Moment moment)
Creates an immutable copy of a moment.
|
static String |
difference(Moment start) |
static String |
difference(Moment start,
Moment finish) |
static boolean |
isFuture(double millis) |
static boolean |
isPast(double millis) |
static Moment |
now() |
static double |
nowPlus(double millis) |
static void |
runLater(Runnable runnable) |
static void |
runUnsafe(RunUnsafe runnable) |
static Moment |
threadStart()
Returns the Moment the current thread began operation,
or the last call to
tick(). |
static void |
tick()
Advances
threadStart() to current time. |
static String |
timestamp() |
static void |
trySleep(int millis,
int nanos) |
public static Moment now()
public static Moment threadStart()
tick().
You are getting an immutable copy of a known snapshot in time.
This is useful to perform an operation "once per run cycle",
provided you don't manually advance the timer in a sloppy fashion.public static void tick()
threadStart() to current time.
This will be called automatically when any task scheduled through X_Time
begins its execution cycle; whenever a process wakes from sleep or gets
pulled off a work queue and ran, the current moment will advance.public static Moment clone(Moment moment)
moment - public static double birth()
public static void runLater(Runnable runnable)
public static void runUnsafe(RunUnsafe runnable)
public static void trySleep(int millis,
int nanos)
public static double nowPlus(double millis)
public static boolean isPast(double millis)
public static boolean isFuture(double millis)
public static String timestamp()
Copyright © December 07, 2012–2015 The Internet Party. All rights reserved.