All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Lee Chin" <leechin@mail.com>
To: 333101@personal.net.py
Cc: hahn@physics.mcmaster.ca, linux-newbie@vger.kernel.org
Subject: Re: usleep
Date: Wed, 11 Jun 2003 19:42:28 -0500	[thread overview]
Message-ID: <20030612004228.40595.qmail@mail.com> (raw)

I'm not sure what you are saying, but yes there are 1 million microseconds in a second.... 1000000 micro seconds that is.  So my loop seems correct.  Also, I am running this on a 2 GhZ processor, so I doubt the 1000 calls to usleep can add that much overhead.  I think something is wrong with the library or the kernel.
----- Original Message -----
From: Alan Bort <333101@personal.net.py>
Date: 11 Jun 2003 19:08:34 +0300
To: Lee Chin <leechin@mail.com>
Subject: Re: usleep

> 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.-
> 

-- 
__________________________________________________________
Sign-up for your own FREE Personalized E-mail at Mail.com
http://www.mail.com/?sr=signup

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

             reply	other threads:[~2003-06-12  0:42 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-06-12  0:42 Lee Chin [this message]
  -- strict thread matches above, loose matches on Subject: below --
2003-06-12 20:43 usleep Lee Chin
2003-06-12  1:04 usleep Lee Chin
2003-06-12  0:53 usleep Lee Chin
2003-06-12  1:02 ` usleep Mark Hahn
2003-06-11 22:55 usleep Lee Chin
2003-06-11 16:08 ` usleep Alan Bort
2003-06-11 23:21 ` usleep CaT
2003-06-11 23:45 ` usleep Mark Hahn
2003-06-11 23:55 ` usleep Ray Olszewski
2003-06-12  0:17   ` usleep Mark Hahn
     [not found]   ` <Pine.LNX.4.44.0306112015380.20310-100000@coffee.psychology .mcmaster.ca>
2003-06-12  0:38     ` usleep Ray Olszewski
2003-06-11 18:45       ` usleep Alan Bort
2003-06-12  4:14       ` usleep Riley Williams
2003-06-12  7:46         ` usleep Ray Olszewski
2003-06-13  1:23   ` usleep Stephen Samuel
2003-06-12 11:47 ` usleep Steven Smith
2003-06-13  1:16 ` usleep Stephen Samuel
2003-06-13  1:22   ` usleep Mark Hahn

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20030612004228.40595.qmail@mail.com \
    --to=leechin@mail.com \
    --cc=333101@personal.net.py \
    --cc=hahn@physics.mcmaster.ca \
    --cc=linux-newbie@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.