/* letemps.c -- * Fares Belhadj - * amsi@ai.univ-paris8.fr * 03/11/2004 */ #include #include #include #include "letemps.h" static struct timeval ti; extern void initTemps(void) { gettimeofday(&ti, (struct timezone*) 0); } double getTemps(void) { struct timeval t; double diff; gettimeofday(&t, (struct timezone*) 0); diff = (t.tv_sec - ti.tv_sec) * 1000000 + (t.tv_usec - ti.tv_usec); return diff/1000000.; }