delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2007/03/01/12:29:25

X-Authentication-Warning: delorie.com: mail set sender to djgpp-workers-bounces using -f
In-Reply-To: <u7mcu2tmm1p9q46ame58tas2bj73vm163g@4ax.com>
Subject: Re: Final version of gettimeofday() patch
To: djgpp-workers AT delorie DOT com
X-Mailer: Lotus Notes Release 7.0.2 September 26, 2006
Message-ID: <OFFAFE93C3.A0A9F63F-ON87257291.005FD04D-87257291.006003C4@seagate.com>
From: Gordon DOT Schumacher AT seagate DOT com
Date: Thu, 1 Mar 2007 10:28:44 -0700
X-MIMETrack: Serialize by Router on SV-GW1/Seagate Internet(Release 7.0.1 HF29|March 07, 2006) at
03/01/2007 09:28:49 AM
MIME-Version: 1.0
X-Proofpoint-FWRule: outbound2
X-Proofpoint-Virus-Version: vendor=fsecure engine=4.65.5502:2.3.11,1.2.37,4.0.164 definitions=2007-03-01_04:2007-03-01,2007-03-01,2007-03-01 signatures=0
Reply-To: djgpp-workers AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp-workers AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

Brian Inglis <Brian DOT Inglis AT SystematicSw DOT ab DOT ca> wrote on 02/28/2007 10:28:31
PM:

# Can someone please check if this is correct and feasible.
# The exact clock rate is 7*5*3*10^6/11/2^19 == 105*10^6/88/2^16 Hz.

I'll take your word for it, but I also trust the number that I've
already got in that file since I've tested it one several machines :)

# Could we do:
#
# typedef unsigned long long int clock_t
# #define CLOCKS_PER_SEC 1000000
# clock() == (rawclock() << 16)*88/105
#
# This would give us a pretty good integer approximation but with unsigned
# int we get a period of just less than 01:11:35 before clock() overflows.

I'm not trying to replace clock() at this point, just trying to
rewrite gettimeofday() so that it's not making a pair of int21
calls on every pass.  The gettimeofday() function gets used in
some performance-critical code (such as the Pth threading library)
so I'm trying to make it as fast as possible.

- Raw text -


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