com.carrotsearch.junitbenchmarks
Enum Clock

java.lang.Object
  extended by java.lang.Enum<Clock>
      extended by com.carrotsearch.junitbenchmarks.Clock
All Implemented Interfaces:
Serializable, Comparable<Clock>

public enum Clock
extends Enum<Clock>

Used to specify what time to measure in BenchmarkOptions.


Enum Constant Summary
CPU_TIME
          Invokes ThreadMXBean.getCurrentThreadCpuTime()
NANO_TIME
          Invokes System.nanoTime()
REAL_TIME
          Invokes System.currentTimeMillis()
USER_TIME
          Invokes ThreadMXBean.getCurrentThreadUserTime()
 
Method Summary
static Clock valueOf(String name)
          Returns the enum constant of this type with the specified name.
static Clock[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

REAL_TIME

public static final Clock REAL_TIME
Invokes System.currentTimeMillis()


NANO_TIME

public static final Clock NANO_TIME
Invokes System.nanoTime()


CPU_TIME

public static final Clock CPU_TIME
Invokes ThreadMXBean.getCurrentThreadCpuTime()


USER_TIME

public static final Clock USER_TIME
Invokes ThreadMXBean.getCurrentThreadUserTime()

Method Detail

values

public static Clock[] 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 (Clock c : Clock.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static Clock valueOf(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:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null


Copyright © 2013 Carrot Search s.c.. All Rights Reserved.