Getting precise elapsed time using Java to the Millisecond
问题 I've been searching for an answer to my dilemma and have found some useful tips but nothing that addresses my specific question, so I was hoping someone here might be able to help me out. I'm trying to get a precise elapsed time to the millisecond in Java. I'm using System.nanoTime() to get the current time and implementing it in the following code. Mind you, this was code that I used to test it's precision. long startTime = System.nanoTime()/1000000; while (true) { System.out.println((System