[comp.windows.x] Measuring Response Time

wbh@cbnewsl.ATT.COM (william.huston) (09/25/89)

I am somewhat new to this news group, so please point me to the
correct source if this subject has been covered before...

I would like to measure the response time of an X application as 
a user perceives it, that is the combination of the client activities and 
the server display function.  How can I do this, from the client 
program, without a stopwatch and a pair of eyes?

It seems to me that I should be able to make the the client request
for display (e.g., realize a new window/widget via XtRealize()), and be
able to time the interval until the server is done displaying the window.
I have tried using XSync(), Xflush(), and XQueryPointer() as ways to 
flush event queues and to wait for the server to respond, but these
functions all seem to return before the display is updated.

Any ideas as to how I can accomplish this would be greatly appreciated.
I should point out that I am using the AT&T OPEN LOOK system and 
toolkit.

		Thanks,
		Bill Huston
		AT&T Bell Labs
		(201) 271-5394
		...!att!tarpon!wbh

asente@decwrl.dec.com (Paul Asente) (09/25/89)

In article <1996@cbnewsl.ATT.COM> wbh@cbnewsl.ATT.COM (william.huston) writes:
>It seems to me that I should be able to make the the client request
>for display (e.g., realize a new window/widget via XtRealize()), and be
>able to time the interval until the server is done displaying the window.
>I have tried using XSync(), Xflush(), and XQueryPointer() as ways to 
>flush event queues and to wait for the server to respond, but these
>functions all seem to return before the display is updated.

XSync should do what you want; it will not return until all queued
requests have been processed by the server.  What you are probably
observing is that the window manager is catching the map requests, so that
all the server is doing to process the map is to send it off to the window
manager.  The map doesn't actually happen until the window manager gets
around to doing it.

What you need is a way of knowing that all the initial expose events have
been processed by the widgets and that they have sent their drawing
requests.  Unfortunately I can't think of any way to do this reliably
since the protocol doesn't define whether expose events for a parent occur
before or after those for a child.

	-paul asente
	    asente@decwrl.dec.com	decwrl!asente