<p>How do i measure how long a client has to wait for a request. </p>

<p>On the server side it is easy, through a filter for example.
But if we want to take into accout the total time including latency and data transfer, it gets diffcult.</p>

<p>is it possible to access the underlying socket to see when the request is finished?
or is it neccessary to do some javascript tricks? maybe through clock synchronisation between browser and server? are there any premade javascripts for this task?</p>

You could set a 0 byte socket send buffer  (and I don't exactly recommend this) so that when your blocking call to HttpResponse.send() you have a closer idea as to when the last byte left, but travel time is not included.
Ekk
--I feel queasy for even mentioning it.  You can do this in Tomcat with connector specific settings. (
Tomcat 6 Connector documentation
)
Or you could come up with some sort of javascript time stamp approach, but I would not expect to set the client clock.  Multiple calls to the web server would have to be made.
timestamp query
the real request
reporting the data
And this approach would cover latency, although you still have have some jitter variance.
Hmmm...interesting problem you have there.  :)