Class TickUtil


  • public class TickUtil
    extends Object
    The utility class for ticks and milliseconds
    • Constructor Detail

      • TickUtil

        public TickUtil()
    • 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