Enum TimePrecision
- java.lang.Object
-
- java.lang.Enum<TimePrecision>
-
- com.anaptecs.jeaf.tools.api.performance.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
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description longgetDurationDivisor()Method returns the divisor that is needed to convert a measurement that is done in nanoseconds into this precision.longgetTPSFactor()Method returns the factor that is needed to calculate the transactions per second based on this unit.java.lang.StringgetUnit()Method returns a string representation of the time precision.static TimePrecisionvalueOf(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.
-
-
-
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 namejava.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.
-
-