計算時間/效能
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);