Johnny Kuiper

Software Engineer

Elapsed time in Java

Whenever I needed to measure the elapsed time of a procedure I always used the currentTimeMillis method from the System class. Just retrieve its returning value before the procedure and substract the value from the returning value retrieved after the procedure. As a result you get the elapsed time in millisecond.