From: "Alex Vinokur" Newsgroups: comp.os.msdos.djgpp Subject: Re: uclock() counts down? Date: Thu, 13 Feb 2003 18:46:37 +0200 Lines: 35 Message-ID: References: <795DD3C2E97585449DCDEEE79CCD5C22BA8C AT email2k DOT compuweigh DOT com> NNTP-Posting-Host: pop09-2ras2-p120.barak.net.il (212.150.105.120) X-Trace: fu-berlin.de 1045154803 46878940 212.150.105.120 (16 [79865]) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com "Alex O" wrote in message news:795DD3C2E97585449DCDEEE79CCD5C22BA8C AT email2k DOT compuweigh DOT com... > Hi everybody, > > I have noticed a strange behavior with uclock() in my program and was just wondering if there is a rational explanation to that. > After some recent changes in the application I have noticed that the time-dependent values on my real-time graphs may flow backwards! I use uclock() to time the change of certain parameters, because they are too fast for clock() (60-100 times per second), and monitoring the return values of uclock() I saw that it in fact may sometimes return smaller values than before for a few calls in a row! > After about a day digging through the code I finally found this strange piece of code: > > uclock(); > .. > inportb(0x40); > > which causes this odd behavior. If reading from the port 0x40 (system's timer register) is commented out or placed before the uclock(), everything works OK. > > Any thoughts why? > > Alex O. > If you work with uclock() on Windows 2000 look at http://groups.google.com/groups?th=f073ad9b3aca2a6a http://groups.google.com/groups?th=ccb93720088dc36d ============================== Alex Vinokur mailto:alexvn AT go DOT to http://www.simtel.net/pub/oth/19088.html ==============================