간단히 만들어본 시각측정 유틸리티
private class TimeChecker { long start, check; StringBuilder sb = new StringBuilder(); public void start() { start = check = System.nanoTime(); sb.append("START").append("\n"); } public void checkTime(String tag) { long curr = System.nanoTime(); long diff = curr - check; sb.append(tag).append("=").append(TimeUnit.NANOSECONDS.toMillis(diff)).append("ms\n"); check = curr; } public String end() { checkTime("END"); long curr = System.nanoTime(); long diff = curr - start; sb.append("TOTAL").append("=").append(TimeUnit.NANOSECONDS.toMillis(diff)).append("ms\n"); return sb.toString(); } }