Unfortunately, I don't know anything about Unix (never even seen it either) so I can't help you there. Short of using a basic timer system, such as the clock() function, I don't have any other alternatives. For proper use, you'd set a starting time and adjust the current time in a loop and until the difference is what you want, then continue on. Here's some pseudo code to give the general idea:
Code:
long StartTime, CurrentTime, EndTime;
StartTime = clock(); // set the starting time
CurrentTime = StartTime;
EndTime = StartTime + 2000; // 2000 milliseconds or 2 seconds
while (CurrentTime < EndTime) // loop until the ending time is reached
{
CurrentTime=clock();
}