top button
Flag Notify
    Connect to us
      Facebook Login
      Site Registration Why to Join

Facebook Login
Site Registration

What is the difference between sleep and usleep in C, please explain with example?

+1 vote
413 views
What is the difference between sleep and usleep in C, please explain with example?
posted Jul 27, 2015 by Tapesh Kulkarni

Share this question
Facebook Share Button Twitter Share Button Google+ Share Button LinkedIn Share Button Multiple Social Share Button

1 Answer

+1 vote

The usleep() function suspends execution of the calling thread for (at least) usec microseconds. The sleep may be lengthened slightly by any system activity or by the time spent processing the call or by the granularity of system timers. while sleep is delaying the execution of a task(could be a thread or anything) for sometime .

For usleep(): http://linux.die.net/man/3/usleep
For sleep() : http://linux.die.net/man/1/sleep

answer Jul 28, 2015 by Amit Kumar Pandey
Contact Us
+91 9880187415
sales@queryhome.net
support@queryhome.net
#280, 3rd floor, 5th Main
6th Sector, HSR Layout
Bangalore-560102
Karnataka INDIA.
QUERY HOME
...