Re: ftime() not giving miliseconds?

Simon Kirby (sim@netnation.com)
Mon, 10 May 1999 18:23:23 -0700 (PDT)


On Mon, 10 May 1999, Pavel Machek wrote:

> Hi!
>
> I've came accross something which looks like a bug.
>
> #include <stdio.h>
> #include <time.h>
> #include <sys/timeb.h>
> #include <unistd.h>
>
> void
> main( int argc, char *argv[] )
> {
> struct timeb tb;
>
> ftime(&tb);
> printf( "It's now %d.%d\n", tb.time, tb.millitm );
> usleep(10000);
> ftime(&tb);
> printf( "It's now %d.%d\n", tb.time, tb.millitm );
> }
>
> Gives me:
>
> pavel@bug:~/misc$ ./timebug
> It's now 926366885.0
> It's now 926366885.0
> pavel@bug:~/misc$ ./timebug
> It's now 926366885.0
> It's now 926366885.0
> pavel@bug:~/misc$ ./timebug
> It's now 926366886.0
> It's now 926366886.0
>
> ...which is bug in my eyes. Kernel 2.2.7, libc-2.0.7.so from debian
> system. I'm not sure if it is kernel or libc...

2.2.8pre4, libc 5.4.46:

---
It's now 926385809.46
It's now 926385809.55
---

Simon-

| Simon Kirby | Systems Administration | | mailto:sim@netnation.com | NetNation Communications | | http://www.netnation.com/ | Tech: (604) 684-6892 |

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/