- Windows-compatible (by disabling, duh..)

This commit is contained in:
ccremers 2006-08-02 09:27:09 +00:00
parent 203b652bab
commit 0c1684e1f2

View File

@ -1,10 +1,12 @@
#include "timer.h" #include "timer.h"
#ifdef linux
#include <time.h> #include <time.h>
#include <sys/times.h> #include <sys/times.h>
static clock_t endwait = 0;
#endif
static int time_max_seconds = 0; static int time_max_seconds = 0;
static clock_t endwait = 0;
//! Set initial time limit. //! Set initial time limit.
/** /**
@ -16,12 +18,16 @@ set_time_limit (int seconds)
if (seconds > 0) if (seconds > 0)
{ {
time_max_seconds = seconds; time_max_seconds = seconds;
#ifdef linux
endwait = seconds * CLK_TCK; endwait = seconds * CLK_TCK;
#endif
} }
else else
{ {
time_max_seconds = 0; time_max_seconds = 0;
#ifdef linux
endwait = 0; endwait = 0;
#endif
} }
} }
@ -36,6 +42,7 @@ get_time_limit ()
int int
passed_time_limit () passed_time_limit ()
{ {
#ifdef linux
if (endwait <= 0) if (endwait <= 0)
{ {
return 0; return 0;
@ -50,4 +57,7 @@ passed_time_limit ()
else else
return 0; return 0;
} }
#else
return 0;
#endif
} }