Package org.openjdk.jmh.runner.options
Class TimeValue
- java.lang.Object
-
- org.openjdk.jmh.runner.options.TimeValue
-
- All Implemented Interfaces:
Serializable
public class TimeValue extends Object implements Serializable
A generic time scalar.- See Also:
- Serialized Form
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description longconvertTo(TimeUnit tu)static TimeValuedays(long v)booleanequals(Object obj)static TimeValuefromString(String timeString)longgetTime()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()StringtoString()static StringtuToString(TimeUnit timeUnit)Converts timeunit to stringly representation.static TimeValuevalueOf(String timeString)Parses time value from a string representation.
-
-
-
Field Detail
-
NONE
public static final TimeValue NONE
-
-
Constructor Detail
-
TimeValue
public TimeValue(long time, 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(TimeUnit tu)
-
getTimeUnit
public TimeUnit getTimeUnit()
-
tuToString
public static String tuToString(TimeUnit timeUnit)
Converts timeunit to stringly representation.- Parameters:
timeUnit- timeunit to convert- Returns:
- string representation
-
valueOf
public static TimeValue valueOf(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
-
sleep
public void sleep() throws InterruptedException- Throws:
InterruptedException
-
-