Which of the following is a best practice to measure time taken by a process for execution?
(a) System.currentTimeMillis()
(b) System.nanoTime()
(c) System.getCurrentTime()
(d) System.getProcessingTime()
I got this question in an internship interview.
This is a very interesting question from Coding best practices in portion Autoboxing & Miscellaneous of Java