LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to give delay() in a c program in linux operating system. (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-give-delay-in-a-c-program-in-linux-operating-system-925380/)

rummana 01-24-2012 12:05 AM

How to give delay() in a c program in linux operating system.
 
Please advice me how to include a delay in my parallelised c program in linux os.

jebe88 01-24-2012 03:56 AM

I assume that 'parallelised' means, you are writing a multi-threaded application. If you want one of your threads to wait for a while, you can use sleep() or nanosleep(). Depending on the multi threading environment you use, there might be more specific functions.
Ask yourself if you really need a delay or if you better should use a mutex or a semaphore instead.


All times are GMT -5. The time now is 05:14 PM.