marnanel: (Default)
Monument ([personal profile] marnanel) wrote2010-03-11 10:08 am
Entry tags:

Finding the current time on the X server

Someone asked me how you can get the current timestamp from an X server.  This is how.
reddragdiva: (Default)

[personal profile] reddragdiva 2010-03-11 10:45 pm (UTC)(link)
Well, okay. But WHY???

(And Xlib is deprecated and everyone should use xcb instead. Apparently.)
pne: A picture of a plush toy, halfway between a duck and a platypus, with a green body and a yellow bill and feet. (Default)

[personal profile] pne 2010-03-12 10:09 am (UTC)(link)
Well, okay. But WHY???

That was pretty much my reaction, too.

May be discordant with reality

(Anonymous) 2010-03-12 10:39 am (UTC)(link)
This is only useful relative to other X timestamps though: note in particular that the X server generally uses CLOCK_MONOTONIC these days, so the timestamp you get back is probably not what gettimeofday() will give you.

Re: May be discordant with reality

(Anonymous) 2010-03-12 10:39 am (UTC)(link)
(that was me. -daniels)