--- trunk/xvidcore/examples/xvid_bench.c 2003/02/16 05:03:55 859 +++ trunk/xvidcore/examples/xvid_bench.c 2003/02/16 05:11:39 860 @@ -35,10 +35,16 @@ #include #include -#include // for gettimeofday #include // for memset #include +#ifndef WIN32 +#include // for gettimeofday +#else +#include +#endif + + #include "xvid.h" // inner guts @@ -56,6 +62,11 @@ #include "bitstream/cbp.h" #include + +#ifndef M_PI +#define M_PI 3.14159265358979323846 +#endif + const int speed_ref = 100; // on slow machines, decrease this value /********************************************************************* @@ -65,9 +76,15 @@ /* returns time in micro-s*/ double gettime_usec() { +#ifndef WIN32 struct timeval tv; gettimeofday(&tv, 0); return tv.tv_sec*1.0e6 + tv.tv_usec; +#else + clock_t clk; + clk = clock(); + return clk * 1000000 / CLOCKS_PER_SEC; +#endif } /* returns squared deviates (mean(v*v)-mean(v)^2) of a 8x8 block */