use evil_time_get() instead of gettimeofday() when using Evil.

It's more precise and involves fewer computations


SVN revision: 39149
This commit is contained in:
Vincent Torri 2009-02-22 19:21:36 +00:00
parent 9d900b283a
commit df41327f29
1 changed files with 8 additions and 4 deletions

View File

@ -13,7 +13,7 @@
#endif
#ifdef HAVE_EVIL
# include <Evil.h> /* for gettimeofday */
# include <Evil.h>
#endif
#include "Ecore.h"
@ -34,13 +34,17 @@
EAPI double
ecore_time_get(void)
{
#ifdef HAVE_GETTIMEOFDAY
#ifdef HAVE_EVIL
return evil_time_get();
#else
# ifdef HAVE_GETTIMEOFDAY
struct timeval timev;
gettimeofday(&timev, NULL);
return (double)timev.tv_sec + (((double)timev.tv_usec) / 1000000);
#else
# error "Your platform isn't supported yet"
# else
# error "Your platform isn't supported yet"
# endif
#endif
}