From: Richard Legner Newsgroups: comp.os.msdos.djgpp Subject: uclock() Date: Thu, 18 Feb 1999 20:25:25 -0600 Organization: Blackstone Janitorial Services Lines: 28 Message-ID: <36CCCB95.AEA6D8FC@whitehorse.net> NNTP-Posting-Host: 199.247.227.202 Mime-Version: 1.0 Content-Type: text/html; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: 919398309 VRL06/YYIE3CAC7F7C usenet55.supernews.com X-Complaints-To: newsabuse AT remarQ DOT com X-Mailer: Mozilla 4.07 [en] (Win95; U) To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com {Compiled with DJGPP 2.8.1.}

I found some very peculiar results when timing (to determine efficiency) different search routines that I wrote. After heaps and stacks of debugging frustration I took a closer look at the output of the code below (just a loop that displays uclock() ticks).

#include<iostream.h>
#include<time.h>

int main(){
    long ticks;
    while (1) {
        ticks = uclock();
        cout << ticks << endl;
    }

     return 0;
}

Sometimes (but not always) the following occurs:

Running and pausing the program  and CLOSELY inspecting the output revealed that
while the values produced by uclock() follow a general ascending trend, they
are  by no means in order.

What could be causing this?

No wonder my searches sometimes take -654 uclock ticks to find the target.