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:
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      See Also:
    • NONE

      public static final TimeValue NONE
    • time

      private final long time
    • timeUnit

      private final TimeUnit timeUnit
  • Constructor Details

    • TimeValue

      public TimeValue(long time, TimeUnit timeUnit)
  • Method Details

    • 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()
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • 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
    • fromString

      public static TimeValue fromString(String timeString)
    • sleep

      public void sleep() throws InterruptedException
      Throws:
      InterruptedException