Java execution time by long startTime = System.nanoTime(); someProcessing(); long endTime = System.nanoTime(); //timeDuration will be in milliseconds, Divide by 1000000 to get milliseconds. long timeDuration = (endTime - startTime); Please follow and like us: