On Mit, 2012-06-27 at 03:49 +0200, Marek Olšák wrote: 
> 
> +GLuint64
> +_mesa_get_cpu_timestamp(void)
> +{
> +#ifndef _WIN32
> +   struct timeval tv;
> +
> +   gettimeofday(&tv, 0);
> +   return (GLuint64)tv.tv_sec * 1000000000ull + (GLuint64)tv.tv_usec * 1000;

As in a recent discussion about DRM vblank counters, it may be better to
use clock_gettime(CLOCK_MONOTONIC, ...) when possible, as gettimeofday()
can move backwards.


-- 
Earthling Michel Dänzer           |                   http://www.amd.com
Libre software enthusiast         |          Debian, X and DRI developer
_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to