From ba3748eb1d478d4377ea003f909c668db90a82c3 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Fri, 6 Oct 2023 12:16:25 +0200 Subject: 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. --- src/java/com/jogamp/common/os/Clock.java | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'src/java/com/jogamp/common/os/Clock.java') 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. + *

+ * Monotonic time shall be used for high-performance measurements of durations, + * since the underlying OS shall support fast calls. + *

+ * @see #getMonotonicStartupTime() + * @see #currentNanos() + * @see #getMonotonicNanos() + */ + public static native long currentMillis(); + + /** + * Returns the unix based current monotonic time in milliseconds. + *

+ * Monotonic time shall be used for high-performance measurements of durations, + * since the underlying OS shall support fast calls. + *

* @see #getMonotonicStartupTime() * @see #currentNanos() * @see #getMonotonicNanos() -- cgit v1.2.3