From b773048aee7ebfb00b7ae7b45ef9f49e88ebc5a4 Mon Sep 17 00:00:00 2001
From: Sven Gothel
- * Note that {@link #currentTimeNanos()} and {@link #getMonotonicNanos()}
+ * Note that {@link #currentNanos()} and {@link #getMonotonicNanos()}
* perform much better than this method, since they only return one long nanosecond value
* since module startup.
* The implementation of this method needs to write two long values into an array.
*
* Monotonic time shall be used for high-performance measurements of durations, * since the underlying OS shall support fast calls. *
*- * Since the returned nanoseconds are counted not from Unix Epoch but start of this application, - * it lasts for 9'223'372'036 seconds or 292 years using the 64-bit type `long`. + * The returned nanoseconds are counted not from Unix Epoch but start of this module, + * hence it lasts for 9'223'372'036 seconds or 292 years using the 64-bit type `long`. + *
+ *+ * Method name doesn't include the term `Time` intentionally, + * since the returned value represent the nanoseconds duration since module start. *
* @see #getMonotonicStartupTime() * @see #getMonotonicNanos() */ - public static native long currentTimeNanos(); + public static native long currentNanos(); /** - * Returns the Instant presentation of monotonic {@link #currentTimeNanos()}. + * Returns the Instant presentation of monotonic {@link #currentNanos()}. ** Monotonic time shall be used for high-performance measurements of durations, * since the underlying OS shall support fast calls. *
*- * Note that the represented time is not from Unix epoch as claimed, - * but monotonic module startup time. + * The returned nanoseconds are counted not from Unix Epoch but start of this module, + * hence it lasts for 9'223'372'036 seconds or 292 years using the 64-bit type `long`. + *
+ *+ * Method name doesn't include the term `Time` intentionally, + * since the returned value represent the nanoseconds duration since module start. *
* @see #getMonotonicStartupTime() - * @see #currentTimeNanos() + * @see #currentNanos() */ public static Instant getMonotonicNanos() { - final long nanos = currentTimeNanos(); + final long nanos = currentNanos(); return Instant.ofEpochSecond(nanos/1000000000L, nanos%1000000000L); } @@ -130,7 +138,7 @@ public class Clock { * Returns current monotonic time in milliseconds. * * @see #getMonotonicStartupTime() - * @see #currentTimeNanos() + * @see #currentNanos() * @see #getMonotonicNanos() */ public static native long currentTimeMillis(); @@ -141,7 +149,7 @@ public class Clock { * * @see #getWallClockTime() * @see #getMonotonicTime() - * @see #currentTimeNanos() + * @see #currentNanos() * @see #getMonotonicNanos() */ public static native long wallClockSeconds(); diff --git a/src/java/com/jogamp/common/util/PerfCounterCtrl.java b/src/java/com/jogamp/common/util/PerfCounterCtrl.java index 30290f8..2c79a2d 100644 --- a/src/java/com/jogamp/common/util/PerfCounterCtrl.java +++ b/src/java/com/jogamp/common/util/PerfCounterCtrl.java @@ -32,7 +32,7 @@ import com.jogamp.common.os.Clock; * Simple performance counter controller. ** Implementation is expected to utilize nanosecond counter since module start, - * e.g. {@link Clock#currentTimeNanos()}. + * e.g. {@link Clock#currentNanos()}. *
*/ public interface PerfCounterCtrl { -- cgit v1.2.3