diff options
author | Sven Göthel <[email protected]> | 2024-01-31 11:29:02 +0100 |
---|---|---|
committer | Sven Göthel <[email protected]> | 2024-01-31 11:29:02 +0100 |
commit | e933eb4cdf939a0b2284bf36e084959ffd4f04b2 (patch) | |
tree | 16c7c46d63d3cfbe4c3907831161432e4ca2c423 | |
parent | dccb9a85e39cf82bd32ef28cb0202e2d486328ec (diff) |
PTS: Add convenient getCurrent() passing Clock.currentMillis() to get(long).
-rw-r--r-- | src/java/com/jogamp/common/av/PTS.java | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/java/com/jogamp/common/av/PTS.java b/src/java/com/jogamp/common/av/PTS.java index 7d6d4fd..0b8a550 100644 --- a/src/java/com/jogamp/common/av/PTS.java +++ b/src/java/com/jogamp/common/av/PTS.java @@ -135,6 +135,8 @@ public final class PTS { public int get(final long currentMillis) { return pts + (int) ( ( currentMillis - scr ) * speed.get() + 0.5f ); } + /** Returns {@link #get(long)} passing {@link Clock#currentMillis()}. */ + public int getCurrent() { return get( Clock.currentMillis() ); } /** Returns {@link #get(long)} as time string representation via {@link #millisToTimeStr(long, boolean)}. */ public String getTimeStr(final long currentMillis, final boolean addFractions) { |