On Tue, 10 Aug 2004, Weidong Cui wrote:

> Does anybody know how X computes the time stamp for xEvents?

The Source, Luke.  Use the Source...

> > xEvent.u.keyButtonPointer.time (aka 'server time'?), defined
> > in X11/Xproto.h, indicates the number of milliseconds elapsed
> > since the X server started.  I want to convert it to an

As far as I can tell that's not so.  Instead, this value appears to be the
elapsed time (in milliseconds) since the server system's Epoch, as defined by
its gettimeofday().  Keep in mind, though, that the server system's Epoch is
not necessarily exactly in sync with the client system's Epoch, even if they
both sync to the same time server, unless of course they are both the same
system.  Also, given this is a 32-bit value, it rolls over every 49.71 days.

FWIW, the X server does not keep track of when it was started.

> > "absolute" time which then can be compared with times
> > recorded by gettimeofday () in some other program.
> > Unfortunately, after spending a lot of time, I still can't
> > find out how to do it.  If you happen to know how to do it,
> > can you please tell me?

Marc.

+----------------------------------+-----------------------------------+
|  Marc Aurele La France           |  work:   1-780-492-9310           |
|  Computing and Network Services  |  fax:    1-780-492-1729           |
|  352 General Services Building   |  email:  [EMAIL PROTECTED]          |
|  University of Alberta           +-----------------------------------+
|  Edmonton, Alberta               |                                   |
|  T6G 2H1                         |     Standard disclaimers apply    |
|  CANADA                          |                                   |
+----------------------------------+-----------------------------------+
XFree86 developer and VP.  ATI driver and X server internals.

_______________________________________________
Devel mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/devel

Reply via email to