diff options
author | Sven Gothel <[email protected]> | 2023-10-06 12:16:25 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2023-10-06 12:16:25 +0200 |
commit | ba3748eb1d478d4377ea003f909c668db90a82c3 (patch) | |
tree | a4725efdf1305bb05bdd790f3e610131831349ab /src/java/com/jogamp/common/os/Clock.java | |
parent | e23a4c7fcc0b585c0708be114fa364e391da4843 (diff) |
Clock/Platform: Add currentMillis() analogue to currentNanos(), returning current monotonic milliseconds **since start of this application**
Also added TSPrinter, a simple millisecond timestamp prepending `print*()` wrapper for a {@link PrintStream}.
Test coverage via TestClock01.
Diffstat (limited to 'src/java/com/jogamp/common/os/Clock.java')
-rw-r--r-- | src/java/com/jogamp/common/os/Clock.java | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/src/java/com/jogamp/common/os/Clock.java b/src/java/com/jogamp/common/os/Clock.java index 9380442..8e9f99d 100644 --- a/src/java/com/jogamp/common/os/Clock.java +++ b/src/java/com/jogamp/common/os/Clock.java @@ -144,8 +144,23 @@ public class Clock { } /** - * Returns current monotonic time in milliseconds. - * + * Returns current monotonic milliseconds since start of this application. + * <p> + * Monotonic time shall be used for high-performance measurements of durations, + * since the underlying OS shall support fast calls. + * </p> + * @see #getMonotonicStartupTime() + * @see #currentNanos() + * @see #getMonotonicNanos() + */ + public static native long currentMillis(); + + /** + * Returns the unix based current monotonic time in milliseconds. + * <p> + * Monotonic time shall be used for high-performance measurements of durations, + * since the underlying OS shall support fast calls. + * </p> * @see #getMonotonicStartupTime() * @see #currentNanos() * @see #getMonotonicNanos() |