How to calculate process elapsed time?
This example shows us how to use the System.nanoTime() method to get the amount of time a process take place. Please be aware that the nano time value is not related to the real world time value.
And example of the result are:
End : 14113497072393
The process took approximately: 1074438 nano seconds