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: [EMAIL PROTECTED] [mailto:uclinux-dev-
> [EMAIL PROTECTED] 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@uclinux.org
> http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
> This message was resent by uclinux-dev@uclinux.org
> To unsubscribe see:
> http://mailman.uclinux.org/mailman/options/uclinux-dev

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

Reply via email to