AW: [uClinux-dev] usleep takes longer as expected

Siegfried Müller mueller at mbconnectline.de
Mon Feb 4 12:01:27 EST 2008


Hi Chris,

usleep(100) means 100usec, usleep(10000) means 10.000usec or 10ms.
Cheers
Siegfried
-----Ursprüngliche Nachricht-----
Von: uclinux-dev-bounces at uclinux.org
[mailto:uclinux-dev-bounces at uclinux.org] Im Auftrag von Chris Doré
Gesendet: Montag, 4. Februar 2008 17:10
An: 'uClinux development list'
Betreff: RE: [uClinux-dev] usleep takes longer as expected


Do you mean 10msec?  Your subject asks about usleep() taking more time
than expected, but then your reported results show that it takes less
time than expected.


..Chris

> -----Original Message-----
> From: uclinux-dev-bounces at uclinux.org [mailto:uclinux-dev- 
> bounces at uclinux.org] On Behalf Of Siegfried Müller
> Sent: February 4, 2008 10:57 AM
> To: 'uClinux development list'
> Subject: [uClinux-dev] usleep takes longer as expected
> 
> Hi,
> I work with the snapgear distro 3.4 and uClibc.
> I use usleep to wait for an exact time, but usleep takes a minimum of 
> 10.000usec. If i use usleep(100) it takes 10.000usec. Why?
> 
> int main(int argc, char *argv[])
>   int i1=0;
>   struct timeval mytime;
>   struct timezone mytimezone;
> 
>   while(i1 < 10){
>     gettimeofday(&mytime,&mytimezone);
>     printf("Test %d, usec=%d,
> sec=%d\n",i1,mytime.tv_usec,mytime.tv_sec);
>     usleep(100);
>     i1++;
>   }
> }
> Does anyone has an idea?
> Cheers
> Siegfried
> 
> _______________________________________________
> uClinux-dev mailing list
> uClinux-dev at uclinux.org 
> http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
> This message was resent by uclinux-dev at uclinux.org
> To unsubscribe see: 
> http://mailman.uclinux.org/mailman/options/uclinux-dev

_______________________________________________
uClinux-dev mailing list
uClinux-dev at uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-dev at uclinux.org
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev



More information about the uClinux-dev mailing list