org.scijava.util
Class Timing
java.lang.Object
org.scijava.util.Timing
public class Timing
- extends Object
A helper class to help with optimizing the performance of a list of
operations.
For example, when trying to figure out which
Service
would be the best candidate to speed up
Context
initialization, this helper comes in real handy:
it accumulates a list of operations with their duration and prints out a
sorted list when asked to.
Use this class as following:
private static Timing timing = new Timing();
...
private void oneOperation() {
final long t1 = System.nanoTime();
...
timing.add(System.nanoTime() - t1, "Operation #1");
}
...
private void atEnd() {
...
timing.report("Operations");
}
- Author:
- Johannes Schindelin
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Timing
public Timing()
reset
public void reset()
addTiming
public void addTiming(Object message)
addTiming
public void addTiming(long duration,
Object message)
report
public void report(String description)
start
public static Timing start(boolean condition)
tick
public static void tick(Timing timing)
tick
public static void tick(Timing timing,
Object message)
stop
public static void stop(Timing timing)
Copyright © 2009–2015 SciJava. All rights reserved.