delorie.com/archives/browse.cgi | search |
From: | Richard Legner <rlegner AT whitehorse DOT net> |
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 |
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 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML> {Compiled with DJGPP 2.8.1.} <P>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). <P>#include<iostream.h> <BR>#include<time.h> <P>int main(){ <BR> long ticks; <BR> while (1) { <BR> ticks = uclock(); <BR> cout << ticks << endl; <BR> } <P> return 0; <BR>} <P>Sometimes (but not always) the following occurs: <P>Running and pausing the program and CLOSELY inspecting the output revealed that <BR>while the values produced by uclock() follow a general ascending trend, they <BR>are by no means in order. <P>What could be causing this? <P>No wonder my searches sometimes take -654 uclock ticks to find the target. <BR> </HTML>
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |