We do this by adding a new cairo_perf_timer_set_finalize function and
in the case of the xlib backend passing a callback to that function
that does a 1x1 XGetImage.
I've seen this improve the std. deviation often by a factor of 2
and occasionally up to a factor of 10. It is sometimes not much
better, but never seems to be appreciably worse compared to using
gettimeofday.
Thanks to David A. Schleef <ds@schleef.org> and his liboil for
the implementation.