Package me.hsgamer.bettergui.util
Class TickUtil
- java.lang.Object
-
- me.hsgamer.bettergui.util.TickUtil
-
public class TickUtil extends Object
The utility class for ticks and milliseconds
-
-
Constructor Summary
Constructors Constructor Description TickUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static long
fpsToMillis(double fps)
Convert FPS (Frame-per-second) to millisecondsstatic long
ticksToMillis(long ticks)
Convert ticks to millisecondsstatic Optional<Long>
toMillis(String input)
Get the milliseconds from the input.
-
-
-
Method Detail
-
ticksToMillis
public static long ticksToMillis(long ticks)
Convert ticks to milliseconds- Parameters:
ticks
- the ticks- Returns:
- the milliseconds
-
fpsToMillis
public static long fpsToMillis(double fps)
Convert FPS (Frame-per-second) to milliseconds- Parameters:
fps
- the FPS- Returns:
- the milliseconds
-
toMillis
public static Optional<Long> toMillis(String input)
Get the milliseconds from the input. The input can be: - A number (in ticks) - A number with "t" at the end (in ticks) - A number with "ms" at the end (in milliseconds) - A number with "fps" at the end (in FPS)- Parameters:
input
- the input- Returns:
- the milliseconds
-
-