-
Which of the following is a best practice to measure time taken by a process for execution?
-
- System.getProcessingTime()
- System.getCurrentTime()
- System.nanoTime()
- System.currentTimeMillis()
- None of these
Correct Option: C
System.nanoTime takes around 1/100000 th of a second whereas System.currentTimeMillis takes around 1/1000th of a second.