[PATCH] Use clock_gettime()'s CLOCK_REALTIME instead of gettimeofday() where possible

Marshall Clow mclow.lists at gmail.com
Wed Mar 11 20:23:52 PDT 2015


@hfinkel wrote:

> Sure, but that has little to do with what POSIX calls its 'monotonic clock'.


Sorry, I used the wrong terminology. The C++ standard **requires** (and large portions of libc++ depend on), the existence of `std::steady_clock`, which is a clock which only moves forward; and does so in real time.  (so reading from a non-steady clock, and then returning the max value you've ever seen is not satisfactory).

An easy way to implement that on POSIX is to use `clock_gettime(CLOCK_MONOTONIC, &tp)`.


http://reviews.llvm.org/D8253

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the cfe-commits mailing list