public static void main(String[] args) throws InterruptedException {
test();
}
public static void test() throws InterruptedException {
StopWatch stopWatch = new StopWatch("test");
stopWatch.start("task1");
Thread.sleep(100);
stopWatch.stop();
stopWatch.start("task2");
Thread.sleep(200);
stopWatch.stop();
System.out.println("*****************");
System.out.println(stopWatch.prettyPrint());
}
-----------------------------------------
ms % Task name
-----------------------------------------
00101 034% task1
00200 066% task2