Enum TimePrecision

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<TimePrecision>

    public enum TimePrecision
    extends java.lang.Enum<TimePrecision>
    Static enum defining the supported precisions of a stop watch
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      MILLIS
      Literal for time precision milliseconds.
      NANOS
      Literal for time precision nanoseconds.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      long getDurationDivisor()
      Method returns the divisor that is needed to convert a measurement that is done in nanoseconds into this precision.
      long getTPSFactor()
      Method returns the factor that is needed to calculate the transactions per second based on this unit.
      java.lang.String getUnit()
      Method returns a string representation of the time precision.
      static TimePrecision valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static TimePrecision[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Enum Constant Detail

      • NANOS

        public static final TimePrecision NANOS
        Literal for time precision nanoseconds.
      • MILLIS

        public static final TimePrecision MILLIS
        Literal for time precision milliseconds.
    • Method Detail

      • values

        public static TimePrecision[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (TimePrecision c : TimePrecision.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static TimePrecision valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • getTPSFactor

        public long getTPSFactor()
        Method returns the factor that is needed to calculate the transactions per second based on this unit.
        Returns:
        long Factor to calculate transactions per second.
      • getDurationDivisor

        public long getDurationDivisor()
        Method returns the divisor that is needed to convert a measurement that is done in nanoseconds into this precision.
        Returns:
        Divisor.
      • getUnit

        public java.lang.String getUnit()
        Method returns a string representation of the time precision.
        Returns:
        String Unit as string. The method never returns null.