usleep() works fine but i have another problem:
Code:
int x=6; /* It will load the cpu with an average of 60% */
while(1){
usleep(x);
fullload(10-x); /* This doen't exist, i have to create it */
}
I need a function that do the inverse of sleep, something that full load's the cpu for a defined time.
Any idea about a funtion that does this?
I was thinking in something like this:
Code:
void fullload(int Delay){
int timeStamp;
timeStamp=currTimeInUSecond(); /* dont know if this exist, need something like this */
/* Pooling until the Delay have pass */
while(currTimeInUSecond()<timeStamp+Delay);
return;
}
Where can i get a similar funcion currTimeInUSecond(); ?