about XSync extension problem.
ajax at nwnk.net
Tue Nov 17 14:21:06 PST 2009
On Tue, 2009-11-17 at 10:21 +0800, lantian ai wrote:
> _X_EXPORT CARD32
> struct timeval tv;
> #ifdef MONOTONIC_CLOCK
> struct timespec tp;
> if (clock_gettime(CLOCK_MONOTONIC, &tp) == 0)
> return (tp.tv_sec * 1000) + (tp.tv_nsec / 1000000L);
> return(tv.tv_sec * 1000) + (tv.tv_usec / 1000);
> May be on desktop we use clock_gettime, on arm we use gettimeofday.
> But when we change the time , both will change? isn't it?
If we were using clock_gettime(CLOCK_REALTIME), then changes to the
system date and time would affect us, same as with gettimeofday(). This
is in fact the _entire_ reason that we use CLOCK_MONOTONIC instead; X's
internal notion of time is related to elapsed time, and not to whatever
the user happened to set the date to.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 198 bytes
Desc: This is a digitally signed message part
More information about the xorg