Javaで処理時間を計測するにはミリ秒で計測するcurrentTimeMillisメソッドと、ナノ秒で計測するnanoTimeメソッドがあります。
今回はナノ秒で計測し、秒で出力する方法です。
double start = System.nanoTime();
//計測したい処理を記述
double end = System.nanoTime();
System.out.println("処理時間:" + ((end - start) / Math.pow(10, 9)) + "s");