Package org.openjdk.jmh.runner.options
Class TimeValue
- java.lang.Object
-
- org.openjdk.jmh.runner.options.TimeValue
-
- All Implemented Interfaces:
java.io.Serializable
public class TimeValue extends java.lang.Object implements java.io.SerializableA generic time scalar.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static TimeValueNONEprivate static longserialVersionUIDprivate longtimeprivate java.util.concurrent.TimeUnittimeUnit
-
Constructor Summary
Constructors Constructor Description TimeValue(long time, java.util.concurrent.TimeUnit timeUnit)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description longconvertTo(java.util.concurrent.TimeUnit tu)static TimeValuedays(long v)booleanequals(java.lang.Object obj)static TimeValuefromString(java.lang.String timeString)longgetTime()java.util.concurrent.TimeUnitgetTimeUnit()inthashCode()static TimeValuehours(long v)static TimeValuemicroseconds(long v)static TimeValuemilliseconds(long v)static TimeValueminutes(long v)static TimeValuenanoseconds(long v)static TimeValueseconds(long v)voidsleep()java.lang.StringtoString()static java.lang.StringtuToString(java.util.concurrent.TimeUnit timeUnit)Converts timeunit to stringly representation.static TimeValuevalueOf(java.lang.String timeString)Parses time value from a string representation.
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
NONE
public static final TimeValue NONE
-
time
private final long time
-
timeUnit
private final java.util.concurrent.TimeUnit timeUnit
-
-
Method Detail
-
days
public static TimeValue days(long v)
-
hours
public static TimeValue hours(long v)
-
microseconds
public static TimeValue microseconds(long v)
-
milliseconds
public static TimeValue milliseconds(long v)
-
minutes
public static TimeValue minutes(long v)
-
nanoseconds
public static TimeValue nanoseconds(long v)
-
seconds
public static TimeValue seconds(long v)
-
getTime
public long getTime()
-
convertTo
public long convertTo(java.util.concurrent.TimeUnit tu)
-
getTimeUnit
public java.util.concurrent.TimeUnit getTimeUnit()
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
tuToString
public static java.lang.String tuToString(java.util.concurrent.TimeUnit timeUnit)
Converts timeunit to stringly representation.- Parameters:
timeUnit- timeunit to convert- Returns:
- string representation
-
valueOf
public static TimeValue valueOf(java.lang.String timeString)
Parses time value from a string representation. This method is called by joptsimple to resolve string values.- Parameters:
timeString- string representation of a time value- Returns:
- TimeValue value
-
fromString
public static TimeValue fromString(java.lang.String timeString)
-
sleep
public void sleep() throws java.lang.InterruptedException- Throws:
java.lang.InterruptedException
-
-