From e933eb4cdf939a0b2284bf36e084959ffd4f04b2 Mon Sep 17 00:00:00 2001 From: Sven Göthel Date: Wed, 31 Jan 2024 11:29:02 +0100 Subject: PTS: Add convenient getCurrent() passing Clock.currentMillis() to get(long). --- src/java/com/jogamp/common/av/PTS.java | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/java') 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) { -- cgit v1.2.3