From f8e8025b75c0a4588849843853b72a3039bdb7f6 Mon Sep 17 00:00:00 2001 From: fcolin Date: Tue, 16 Jun 1998 09:26:08 +0000 Subject: Modif timer.c --- src/timer.c | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) (limited to 'src/timer.c') diff --git a/src/timer.c b/src/timer.c index a1fb791..dfa10bd 100644 --- a/src/timer.c +++ b/src/timer.c @@ -1,12 +1,13 @@ /* Module de gestion des timers autour d'un select */ #include #include -#include -#include #include +#include #include #ifdef WIN32 #include +#else +#include #endif #include "list.h" #include "timer.h" @@ -33,17 +34,15 @@ TimerId timers = NULL; static long currentTime() { - struct timeval tv; - unsigned long current; - gettimeofday (&tv, 0); - current = 1000 * tv.tv_sec + tv.tv_usec / 1000; - return current; - -#if 0 unsigned long current; - current = clock(); - return current; +#ifdef WIN32 + current = GetTickCount(); +#else + struct timeval stamp; + gettimeofday( &stamp, NULL ); + current = stamp.tv_sec * MILLISEC + stamp.tv_usec/MILLISEC; #endif + return current; } static void SetNewTimeout( unsigned long current, unsigned long when ) { -- cgit v1.1