Help answer threads with 0 replies.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 04-28-2004, 10:56 AM   #1
Registered: Apr 2003
Posts: 178

Rep: Reputation: 30
Is the wait function is the same as the sleep function ?

Is the wait function is the same as the sleep function ?


Is the wait function in C
is the same as the sleep function in BASH ?

I ran the program below, and it does not seemed that the
wait function is activated because the print statement
printf ("Not in the while loop\n"); print right away, and there was not any delay.
#include <stdio.h>


     int true = 1;
     while (true == 0)
           printf ("IN THE WHILE LOOP\n");
     printf ("Not in the while loop\n");

Last edited by Linh; 04-28-2004 at 11:21 AM.
Old 04-28-2004, 11:01 AM   #2
Registered: Aug 2003
Location: Santa Clara, CA
Distribution: Slackware
Posts: 895

Rep: Reputation: 32
Type: man wait and you will see that wait is not the same as sleep. (wait, waits for a thread to exit)
Type: man 3 sleep and you will see that C also has a sleep function defined in unistd.h

Last edited by deiussum; 04-28-2004 at 11:04 AM.
Old 04-28-2004, 11:20 AM   #3
Registered: Apr 2003
Posts: 178

Original Poster
Rep: Reputation: 30

Thank you deiussum for your help.
Old 04-28-2004, 12:39 PM   #4
Registered: Mar 2003
Posts: 804

Rep: Reputation: 30
LOL i answered ur question over at devshed a min ago


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to disable the Monitor Sleep function under RH9 ?? 242VDM242 Linux - Newbie 1 05-21-2005 01:51 PM
looking for a Sleep() function Mike Davies Linux - Software 2 10-25-2004 08:11 AM
wait( ) function usage, howto? feetyouwell Programming 5 09-21-2004 11:04 AM
A main can be changed by a function local without passing anything to the function? ananthbv Programming 10 05-04-2004 01:31 PM
help using rtc as a more accurate replacement for python's 'sleep' function kernelpanicguy Programming 0 11-29-2003 12:36 AM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 10:49 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration