Package gg.xp.reevent.time
Class TimeUtils
java.lang.Object
gg.xp.reevent.time.TimeUtils
-
Method Summary
Modifier and TypeMethodDescriptionstatic Duration
clampDuration
(Duration input, Duration min, Duration max) static Instant
clampInstant
(Instant input, Instant min, Instant max) static double
durationToDouble
(Duration input) Converts a duration to a double representing seconds and ms.static Instant
now()
-
Method Details
-
now
-
clampInstant
-
clampDuration
-
durationToDouble
Converts a duration to a double representing seconds and ms. e.g. 1200ms becomes 1.2. 1.33333.... becomes 1.333.- Parameters:
input
- A duration- Returns:
- A double representing seconds, with 3 digits of precision past the decimal.
-