Mail Archives: djgpp/1999/05/16/10:23:53
On Sun, 16 May 1999, Sean wrote:
> Eli Zaretskii wrote:
> > First, please post a short test program that exhibits this behavior.
>
> I had something like:
>
> int t = (int)uclock();
> while(t < 0x2000)
> {
> printf("%i", t);
> t = (int)uclock();
> }
How did you expect this to work? `uclock_t' is typedef for
"long long" (see the header time.h), which is a 64-bit quantity.
When you cast it to an int, which is a 32-bit quantity, you lose
all of the upper 32 bits, and look at the least-significant bits
only!
What you need to do is to use the %Ld format specifier to print the
entire uclock_t result, without casting it. *Then* look at the
numbers and see if they make sense.
- Raw text -