Home » JAVA Programming » Java Basic » Question
  1. Which of the following is a best practice to measure time taken by a process for execution?
    1. System.getProcessingTime()
    2. System.getCurrentTime()
    3. System.nanoTime()
    4. System.currentTimeMillis()
    5. 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.



Your comments will be displayed only after manual approval.