fix timeWaiting computation in TimeUtil
Summary:
Some of the code in TimeUtil.cpp computes how long the current thread has spent
waiting to be schedule on the CPU, so we can discount this time when testing
timeout behavior.
It appears that this code has been broken for a fairly long time. Older Linux
kernels reported values in /proc/<pid>/schedstat using jiffies. However, it
appears that this was changed in Linux 2.6.23 to report values using
nanoseconds. (It looks to me like this was changed in commit
425e0968a25f,
which purports to simply be moving code from sched.c to sched_stats.h,
but it appears to also have also changed this behavior.)
This updates TimeUtil.cpp to compute the value correctly in modern Linux
kernels.
Reviewed By: yfeldblum
Differential Revision:
D5173598
fbshipit-source-id:
98436d3a687400bf68661156ffce93eea7232632