ナノ秒単位での時間計測

  • 17
    Like
  • 0
    Comment
More than 1 year has passed since last update.

JavaでSystem.nanoTimeを使って処理時間を計測します

long start = System.nanoTime();
// Some processing
long end = System.nanoTime();
System.out.println("Time:" + (end - start) / 1000000f + "ms");