dk.cooldev.timing.Marker Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of easytiming Show documentation
Show all versions of easytiming Show documentation
Easy way to measure your code
The newest version!
package dk.cooldev.timing;
/**
* Created by cvwj on 07/08/14.
*/
public class Marker {
private static ThreadLocal tl = new ThreadLocal();
public static void init() {
tl.set(new TimeMarker());
}
public static void mark(Class clazz, String methodName, String eventName) {
tl.get().mark(clazz, methodName, eventName);
}
public static TimeMarker stop() {
TimeMarker timeMarker = tl.get();
timeMarker.stop();
tl.set(null);
return timeMarker;
}
public static TimeMarker get() {
return tl.get();
}
}