Mail Archives: djgpp/1999/11/07/12:51:15
On Fri, 5 Nov 1999, N J Chackowsky wrote:
> t1, t2 : longword;
> seconds : real;
> begin
> t1 := uclock;
> {do something -- in this case, a simple sort of an array of integers}
> t2 := uclock;
> seconds := (t2-t1)/TXPRS;
> writeln(seconds:0:5);
>
> If I do a selection sort of 1000 integers, the writeln reports
> preposterously large results. If I move up to 10000 items, it *appears*
> to work correctly.
You didn't tel on what OS this happens. If it was on Windows 9X, then
this is a known problem: uclock reprograms the timer chip, but Windows
delays the effect of that reprogramming for at least one timer tick,
so the initial values you get from uclock may be negative on Windows.
The next release of DJGPP works around this Windows misfeature. You
can get a source-level patch for uclock from the DJGPP bug-tracking
system, http://www.delorie.com/djgpp/bugs/.
> [I've had ***BAD*** luck lately posting so I'm being paranoid here... no
> html; posting to one group, ahhhhh... looks goood?...]
No HTML this time; thanks.
- Raw text -