usleep(1000) is not working

Oct 4, 2012 at 7:20am
Hello Everyone,

My process was using 90% cpu so i have used usleep(1000).

but after using this also nothing is happening my process is using same cpu.

Please need a help for this.
Oct 4, 2012 at 8:37am
The parameter to usleep() is in microseconds (hence the u: a convenient way to write the Greek letter mu). Thus, usleep(1000) yields for 1 millisecond.
Oct 4, 2012 at 9:12am
Hey Helios,

I have given usleep(10000) means (100 millisecond) but also my service is taking to 70 to 80 CPU
Oct 4, 2012 at 10:24am
10000 microseconds is 10 milliseconds.
Oct 4, 2012 at 10:28am
Dear peter,

Ya . i got that..
but my que is how to minimize the cpu utilization?
Oct 4, 2012 at 1:20pm
but my que is how to minimize the cpu utilization?
That's impossible to answer without some kind of context.
Oct 4, 2012 at 3:19pm
Write a more efficient program maybe?
Topic archived. No new replies allowed.