home *** CD-ROM | disk | FTP | other *** search
- /*
- * Replacement for the buggy clock() function in GCC WarpUP.
- * Written by Jarmo Laakkonen jami.laakkonen@kolumbus.fi
- *
- */
-
- #include <time.h>
- #include <powerpc/powerpc_protos.h>
-
- clock_t clock(void)
- {
- struct timeval tv;
- static ULONG start_time = 0;
- ULONG current_time;
-
- GetSysTimePPC(&tv);
-
- if (!start_time)
- start_time = tv.tv_secs;
-
- current_time = tv.tv_secs;
-
- return (current_time - start_time) * CLOCKS_PER_SEC;
- }
-