https://codereview.chromium.org/51333007/diff/1/src/platform/time.cc
File src/platform/time.cc (right):
https://codereview.chromium.org/51333007/diff/1/src/platform/time.cc#newcode305
src/platform/time.cc:305: Time Time::Now() {
On 2013/10/30 13:38:56, ben2 wrote:
On 2013/10/30 12:49:15, Benedikt Meurer wrote:
> Time::Now() has to use gettimeofday() on POSIX systems or
CLOCK_REALTIME.
You mean CLOCK_REALTIME_COARSE is not allowed? If so, why is that?
> It should return a Time value not a TimeTicks value.
Not sure what you mean. Time::FromTimespec() returns a Time, right?
CLOCK_MONOTONIC != CLOCK_REALTIME. Time values have to use the realtime
clock.
https://codereview.chromium.org/51333007/diff/1/src/platform/time.cc#newcode606
src/platform/time.cc:606: int result = GetBestMonotonicClock(&ts);
On 2013/10/30 13:38:56, ben2 wrote:
On 2013/10/30 12:49:15, Benedikt Meurer wrote:
> Please take a look at the Xorg GetTimeInMillis() function in
os/utils.c. I
think
> we should use something similar here; can be safely inlined into the
> HighResolutionNow() function, IMHO.
What in particular do you want to steal^Wcopy? The extra check for
CLOCK_MONOTONIC?
static clockid_t clockid;
if (!clockid) {
#ifdef CLOCK_MONOTONIC_COARSE
if (clock_getres(CLOCK_MONOTONIC_COARSE, &tp) == 0 &&
(tp.tv_nsec / 1000) <= 1000 &&
clock_gettime(CLOCK_MONOTONIC_COARSE, &tp) == 0)
clockid = CLOCK_MONOTONIC_COARSE;
else
#endif
clockid = CLOCK_MONOTONIC;
}
int result = clock_gettime(clockid, &tp);
https://codereview.chromium.org/51333007/
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.