Restored check for gettimeofday to fix OS X build.

Change-Id: I99e14ee1c42599f4b9d13e97824aa454025f0219