facebook/jcommon — pull request #26 by l3fang (2013-07-24 16:18:13+00:00)
Title: Try to use System.nanotime instead of System.currentTimeMills for measuring time in stats

System.currentTimeMillis calls gettimeofday() in Linux. System.nanoTime() calls clock_gettime(). According to http://stackoverflow.com/questions/12392278/measure-time-in-linux-getrusage-vs-clock-gettime-vs-clock-vs-gettimeofday, gettimeofday() is hardly the right choice for measuring passage of time since it is wall clock time and is subject to a lot of external factors (leap seconds, ntpd resets, daylight savings).

This pull request tried to build a bridge class DateTimeUtils that uses System.nanoTime() under the hood. Since the code currently uses joda time extensively, refactoring all of it is worth doing only if people showed interest in this pull request. Suggestions on how to make this patch cleaner is greatly appreciated.