|
" 2013 FRC Java API " |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sun.squawk.util.ComputationTimer
public final class ComputationTimer
This is a singleton class that provides support for timing computations, including nested computations.
Nested Class Summary | |
---|---|
static interface |
ComputationTimer.Computation
A computation to be timed that does not throw a checked exception. |
static interface |
ComputationTimer.ComputationException
A computation to be timed that throws a checked exception. |
Method Summary | |
---|---|
static void |
dump(PrintStream out)
Print a summary of the times. |
static Enumeration |
getComputations()
Gets an enumeration over the identifiers of computations for which times were collected. |
static Enumeration |
getFlatTimes()
Gets an enumeration over the collected flat times. |
static Enumeration |
getTotalTimes()
Gets an enumeration over the collected accumulative times. |
static void |
reset()
Resets all the data gathered by the timer. |
static Object |
time(String id,
ComputationTimer.Computation computation)
Time a specified computation denoted by a specified identifier. |
static Object |
time(String id,
ComputationTimer.ComputationException computation)
Time a specified computation denoted by a specified identifier. |
static String |
timesAsString()
Returns a string representation of the times accumulated by the timer in the form of a set of entries, enclosed in braces and separated by the ASCII characters ", " (comma and space). |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static Object time(String id, ComputationTimer.Computation computation)
id
- the identifier for the computationcomputation
- the computation to be performed and timed
public static Object time(String id, ComputationTimer.ComputationException computation) throws Exception
id
- the identifier for the computationcomputation
- the computation to be performed and timed
Exception
public static Enumeration getComputations()
public static Enumeration getFlatTimes()
public static Enumeration getTotalTimes()
public static void reset()
IllegalStateException
- if there is an execution currently being timedpublic static String timesAsString()
public static void dump(PrintStream out)
out
- PrintStream
|
" 2013 FRC Java API " |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |