usleep(1000) is not working

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.
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.
Hey Helios,

I have given usleep(10000) means (100 millisecond) but also my service is taking to 70 to 80 CPU
10000 microseconds is 10 milliseconds.
Dear peter,

Ya . i got that..
but my que is how to minimize the cpu utilization?
but my que is how to minimize the cpu utilization?
That's impossible to answer without some kind of context.
Write a more efficient program maybe?
Topic archived. No new replies allowed.