diff options
author | Sven Gothel <[email protected]> | 2023-03-07 01:16:30 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2023-03-07 01:16:30 +0100 |
commit | 6545ab42048dfda5f6cb72ce272a331078cd200e (patch) | |
tree | 920b02fb4b62df0c4780c6f685ba9ae07b6bc192 /src/java/com/jogamp/common/os | |
parent | 1842451b0e49ac1899ed3ab3515021a6077aff92 (diff) |
Clock: Use Clock.currentNanos() instead of System.nanoTime()
Diffstat (limited to 'src/java/com/jogamp/common/os')
-rw-r--r-- | src/java/com/jogamp/common/os/Platform.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/java/com/jogamp/common/os/Platform.java b/src/java/com/jogamp/common/os/Platform.java index 9c65596..ffea42c 100644 --- a/src/java/com/jogamp/common/os/Platform.java +++ b/src/java/com/jogamp/common/os/Platform.java @@ -540,11 +540,11 @@ public class Platform extends PlatformPropsImpl { } private static long getCurrentSleepJitterImpl(final long nsDuration, final int splitInLoops) { final long nsPeriod = nsDuration / splitInLoops; - final long t0_ns = System.nanoTime(); + final long t0_ns = Clock.currentNanos(); for(int i=splitInLoops; i>0; i--) { try { TimeUnit.NANOSECONDS.sleep(nsPeriod); } catch (final InterruptedException e) { } } - return ( ( System.nanoTime() - t0_ns ) - nsDuration ) / splitInLoops; + return ( ( Clock.currentNanos() - t0_ns ) - nsDuration ) / splitInLoops; } } |