home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
AmigActive 13
/
AACD13.ISO
/
AACD
/
Sound
/
LAME
/
src
/
new_clock.c
< prev
next >
Wrap
C/C++ Source or Header
|
2000-08-09
|
431b
|
25 lines
/*
* 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;
}