kymbrik
11/15/2017 - 10:25 AM

How do I calculate the time taken for the execution of a method in Java

Stopwatch stopwatch = Stopwatch.createStarted();
		//process
stopwatch.stop(); // optional
System.out.println("Time elapsed for myCall() is " + stopwatch.elapsed(TimeUnit.MINUTES));