24 lines
278 B
C
24 lines
278 B
C
|
/*
|
||
|
* sleep.c
|
||
|
*
|
||
|
* Stefan Haubenthal, 2003-06-11
|
||
|
* Ullrich von Bassewitz, 2003-06-12
|
||
|
*
|
||
|
*/
|
||
|
|
||
|
|
||
|
|
||
|
#include <time.h>
|
||
|
|
||
|
|
||
|
|
||
|
unsigned sleep (unsigned wait)
|
||
|
{
|
||
|
clock_t goal = clock () + ((clock_t) wait) * CLOCKS_PER_SEC;
|
||
|
while ((long) (goal - clock ()) > 0) ;
|
||
|
return 0;
|
||
|
}
|
||
|
|
||
|
|
||
|
|