1
0
mirror of https://github.com/cc65/cc65.git synced 2024-12-23 04:30:10 +00:00
cc65/libsrc/common/sleep.c
Greg King 0390c34e88 Changed multi-line C comments into another style.
The left side doesn't look unbalanced.
2014-06-30 16:51:07 -04:00

28 lines
418 B
C

/*
** sleep.c
**
** Stefan Haubenthal, 2003-06-11
** Ullrich von Bassewitz, 2003-06-12
**
*/
#include <time.h>
#include <unistd.h>
/* We cannot implement this function without a working clock function */
#if defined(CLOCKS_PER_SEC)
unsigned __fastcall__ sleep (unsigned wait)
{
clock_t goal = clock () + ((clock_t) wait) * CLOCKS_PER_SEC;
while ((long) (goal - clock ()) > 0) ;
return 0;
}
#endif