計算時間/效能

Posted by Bruce Tsai

狀況:用 System.currentTimeMillis()

long start = System.currentTimeMillis(); 
long time = System.currentTimeMillis() - start;

正確做法

StopWatch stopwatch = new StopWatch();
stopwatch.start();
stopwatch.stop();
System.out.println(stopwatch);

results matching ""

    No results matching ""