www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/11/07/12:51:15

Date: Sun, 7 Nov 1999 17:26:09 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: N J Chackowsky <nick AT arcticmail DOT com>
cc: djgpp AT delorie DOT com
Subject: Re: DJGPP/Gnu Pascal problem
In-Reply-To: <38231BF1.91ADD896@arcticmail.com>
Message-ID: <Pine.SUN.3.91.991107172547.12805e-100000@is>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019