Jak mierzyć performance funkcji w javie
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
}
}
0 komentarze: