1 23 24 29 30 package com.sun.enterprise.util.diagnostics; 31 32 import java.util.*; 33 import com.sun.enterprise.util.diagnostics.Reporter; 34 import com.sun.enterprise.util.StringUtils; 35 46 47 public class Profiler 48 { 49 private Profiler() 50 { 51 } 52 54 public static void reset() 55 { 56 profiler.reset(); 57 } 58 60 public static void beginItem() 61 { 62 profiler.beginItem(); 63 } 64 67 public static void beginItem(String desc) 68 { 69 profiler.beginItem(desc); 70 } 71 73 public static void endItem() 74 { 75 profiler.endItem(); 76 } 77 79 public static String report() 80 { 81 return profiler.toString(); 82 } 83 84 86 88 public static void main(String [] notUsed) 89 { 90 try 91 { 92 profiler.beginItem("first item"); 93 Thread.sleep(3000); 94 profiler.beginItem("second item here dude whoa yowser yowser"); 95 Thread.sleep(1500); 96 profiler.endItem(); 97 profiler.endItem(); 98 System.out.println("" + profiler); 99 } 100 catch(Exception e) 101 { 102 } 103 } 104 105 static ProfilerImpl profiler = new ProfilerImpl(); 106 } 107 | Popular Tags |