Jak mierzyć performance funkcji w javie

01:13 0 Comments

public class Test {

 public static void main(String[] args){
      
      UnderTest.start("");
      UnderTest.runTestMethod();
      UnderTest.stop("");  
 } 
}

public class UnderTest {

 private static long start, stop;
  
 public static void start(String details)
 {
      System.out.println("Start " + details);
      start = System.currentTimeMillis();
 }
 
 public static void stop(String details)
 {
      stop = System.currentTimeMillis() - start;
      System.out.println(details + "Time after for loop = " + stop);
 }
 
 public static void runTestMethod() {
      //todo
 }
}

ziomyslaw

Some say he’s half man half fish, others say he’s more of a seventy/thirty split. Either way he’s a fishy bastard.

0 komentarze: