Thanks for the patch.
Can you also replace the code that uses System.currentTimeMillis() with System.nanoTime().
The reason is that the granularity of System.currentTimeMillis() depends on the implementation and on the OS and is usually around 10 ms (up to 100ms on some platforms). Instead, System.nanoTime() returns the current value of the most precise available system timer (in nanoseconds). The latter is perfect to calculate elapsed time. Specially, in Hadoop, we can use org.apache.hadoop.util#monotonicNow() for getting the start/end time.