20 #include <sys/types.h>
47 struct timespec mrqtp;
48 mrqtp.tv_sec = iTimeVal;
51 return nanosleep(&mrqtp, NULL);
53 return sleep(iTimeVal);
65 struct timespec mrqtp;
66 mrqtp.tv_sec = iTimeVal/1000000;
67 mrqtp.tv_nsec = (iTimeVal - (mrqtp.tv_sec * 1000000)) * 1000;
69 return nanosleep(&mrqtp, NULL);
72 tv.tv_sec = iTimeVal/1000000;
73 tv.tv_usec = iTimeVal - (tv.tv_sec * 1000000);
74 return select(0, NULL, NULL, NULL, &tv);
78 INTERNAL
int SYS_RandomInt(
int fStart,
int fEnd)
80 static int iInitialized = 0;
83 if (0 == iInitialized)
93 iRandNum = ((rand()+0.0)/RAND_MAX * (fEnd - fStart)) + fStart;
98 INTERNAL
int SYS_GetSeed(
void)
104 tz.tz_minuteswest = 0;
106 if (gettimeofday(&tv, &tz) == 0)
111 myseed = (long) time(NULL);
This handles abstract system level calls.
int SYS_Sleep(int)
Makes the current process sleep for some seconds.
int SYS_USleep(int)
Makes the current process sleep for some microseconds.