diff options
author | Sven Gothel <[email protected]> | 2023-03-07 01:33:22 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2023-03-07 01:33:22 +0100 |
commit | fb03e913c0c55a9a96e93a00ef6590b9bea9a62a (patch) | |
tree | 060fab60bd6a7f926703c2aedfa00ea466e507fb /src/newt/classes/com | |
parent | 607eb99b9cad227dd7be6d149c6b6cf57d060c35 (diff) |
Clock: Use Clock.currentNanos() instead of System.nanoTime(); Enhancing FPSCounterImpl accuracy by maintaining timestamps in [ns]
Idea: Perhaps we want to use [ns] for FPSCounter's method types by now?
Diffstat (limited to 'src/newt/classes/com')
-rw-r--r-- | src/newt/classes/com/jogamp/newt/opengl/GLWindow.java | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java b/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java index 6b102ea68..1435aa20a 100644 --- a/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java +++ b/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java @@ -73,6 +73,7 @@ import jogamp.opengl.GLContextImpl; import jogamp.opengl.GLDrawableImpl; import com.jogamp.common.GlueGenVersion; +import com.jogamp.common.os.Clock; import com.jogamp.common.util.SecurityUtil; import com.jogamp.common.util.VersionUtil; import com.jogamp.common.util.locks.RecursiveLock; @@ -679,7 +680,7 @@ public class GLWindow extends GLAutoDrawableBase implements GLAutoDrawable, Wind public synchronized void setVisibleActionPost(final boolean visible, final boolean nativeWindowCreated) { long t0; if(Window.DEBUG_IMPLEMENTATION) { - t0 = System.nanoTime(); + t0 = Clock.currentNanos(); System.err.println("GLWindow.setVisibleActionPost("+visible+", "+nativeWindowCreated+") "+WindowImpl.getThreadName()+", start"); } else { t0 = 0; @@ -710,7 +711,7 @@ public class GLWindow extends GLAutoDrawableBase implements GLAutoDrawable, Wind } } if(Window.DEBUG_IMPLEMENTATION) { - System.err.println("GLWindow.setVisibleActionPost("+visible+", "+nativeWindowCreated+") "+WindowImpl.getThreadName()+", fin: dt "+ (System.nanoTime()-t0)/1e6 +"ms"); + System.err.println("GLWindow.setVisibleActionPost("+visible+", "+nativeWindowCreated+") "+WindowImpl.getThreadName()+", fin: dt "+ (Clock.currentNanos()-t0)/1e6 +"ms"); } } |