public class Timings extends Object
This class is inspired by how java.util.logging.Logger works, where Logger.getLogger(String) either create new Logger or get the existing Logger, and the '.'(dot) in the name indicating the hierarchy of the Loggers. For example, Timings.getTiming("my.timing.name") would yield three level of hierarchy: 'my', 'timing', and 'name', and 'timing' would be the child of 'my' and 'name' would be child of 'timing.'
Modifier and Type | Class and Description |
---|---|
static class |
Timings.LimboTiming |
static class |
Timings.Timing |
Modifier and Type | Field and Description |
---|---|
static Timings.Timing |
LIMBO |
static boolean |
on |
Constructor and Description |
---|
Timings() |
Modifier and Type | Method and Description |
---|---|
static Timings.Timing |
getTiming(String name)
Get the timing with given name or create if not exist.
|
static void |
print(Timings.Timing timing,
OutputStream stream) |
static void |
printAll(OutputStream stream) |
static void |
reset()
Reset the root Timing to initial state.
|
public static final Timings.Timing LIMBO
public static boolean on
public static void reset()
public static Timings.Timing getTiming(String name)
name
- the fully qualified name of the timing. null will yield root (root of all the timings)public static void print(Timings.Timing timing, OutputStream stream) throws IOException
IOException
public static void printAll(OutputStream stream) throws IOException
IOException