for the #include statemen I assume you are using some sort of C
languagbe (even C, C++ or C#) Well... my man of usleep says that it
makes the system wait for any number of microseconds... make the maths.

Anyway... I really don't remebmer the value of a microsecond... I THINK
it was something like "1 x 10 ^ -6" or something alike... (excuse the
quotation aberration).


El jue, 12-06-2003 a las 01:55, Lee Chin escribió:
> I would think the following code would wait for 1 second each itteration before 
> printing hello, but it waits way too long.  Replacing the for loop body with a 
> usleep(1000000) works great... what am I missing here?
> 
> Thanks
> Lee
> 
> #include <unistd.h>
> 
> int main()
> {
>     while (1)
>     {
>         int i;
> 
>         printf("hello\n");
>         for(i = 0; i < 50; i++)
>         {
>             usleep(1000);
>         }
> 
>     }
> 
> }
-- 
Alan Bort
Linux Registered User 298277 -Country Manager- [http://counter.li.org]
[ http://www.linuxquestions.org ] Username: Ciccio
[ http://es.tldp.org ]
Ciccio.-

-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs

Reply via email to