1 23 24 34 35 package com.sun.ejb.codegen; 36 37 40 41 public class IASEJBCTimes 42 { 43 public IASEJBCTimes() 44 { 45 } 46 47 49 public long getTotalTime() 50 { 51 return totalTime; 52 } 53 54 56 public String toString() 57 { 58 StringBuffer sb = new StringBuffer (); 59 sb.append("Total Time for EJBC: " + totalTime + " msec, "); 60 sb.append(makeEntry("CMP Generation", cmpGeneratorTime)); 61 sb.append(makeEntry("Java Compilation", javaCompileTime)); 62 sb.append(makeEntry("RMI Compilation", RMICompileTime)); 63 sb.append(makeEntry("JAX-RPC Generation", jaxrpcGenerationTime)); 64 sb.append("\n"); 65 return sb.toString(); 66 } 67 68 70 private String makeEntry(String title, long time) 71 { 72 return title + ": " + time + " msec (" + percent(time) + "), "; 73 } 74 75 77 private String percent(long time) 78 { 79 if(totalTime <= 0) 80 return "0%"; 81 82 return "" + ((time * 100) / totalTime) + "%"; 83 } 84 85 87 long cmpGeneratorTime = 0; 88 long javaCompileTime = 0; 89 long RMICompileTime = 0; 90 long jaxrpcGenerationTime = 0; 91 long totalTime = 0; 92 93 } 94 | Popular Tags |