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.Serializable
A generic time scalar.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static TimeValue
NONE
private static long
serialVersionUID
private long
time
private java.util.concurrent.TimeUnit
timeUnit
-
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 long
convertTo(java.util.concurrent.TimeUnit tu)
static TimeValue
days(long v)
boolean
equals(java.lang.Object obj)
static TimeValue
fromString(java.lang.String timeString)
long
getTime()
java.util.concurrent.TimeUnit
getTimeUnit()
int
hashCode()
static TimeValue
hours(long v)
static TimeValue
microseconds(long v)
static TimeValue
milliseconds(long v)
static TimeValue
minutes(long v)
static TimeValue
nanoseconds(long v)
static TimeValue
seconds(long v)
void
sleep()
java.lang.String
toString()
static java.lang.String
tuToString(java.util.concurrent.TimeUnit timeUnit)
Converts timeunit to stringly representation.static TimeValue
valueOf(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:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in 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
-
-