diff options
-rw-r--r-- | src/main/java/org/openslx/util/Util.java | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/main/java/org/openslx/util/Util.java b/src/main/java/org/openslx/util/Util.java index f475d01..8593f80 100644 --- a/src/main/java/org/openslx/util/Util.java +++ b/src/main/java/org/openslx/util/Util.java @@ -118,9 +118,20 @@ public class Util } } + /** + * Number of seconds elapsed since 1970-01-01 UTC. + */ public static long unixTime() { return System.currentTimeMillis() / 1000; } + /** + * Monotonic tick count in milliseconds, not bound to RTC. + */ + public static long tickCount() + { + return System.nanoTime() / 1000; + } + } |