www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2007/03/02/03:24:46

X-Authentication-Warning: delorie.com: mail set sender to djgpp-workers-bounces using -f
Date: Fri, 02 Mar 2007 01:23:34 -0700
From: Brian Inglis <Brian DOT Inglis AT SystematicSw DOT ab DOT ca>
Subject: Re: Final version of gettimeofday() patch
In-reply-to:
<OFFAFE93C3 DOT A0A9F63F-ON87257291 DOT 005FD04D-87257291 DOT 006003C4 AT seagate DOT com>
To: djgpp-workers AT delorie DOT com
Message-id: <5nnfu215a36k0m3tikd9teeoh2p3p4e3lv@4ax.com>
Organization: Systematic Software
MIME-version: 1.0
X-Mailer: Forte Agent 1.93/32.576 English (American)
References: <u7mcu2tmm1p9q46ame58tas2bj73vm163g AT 4ax DOT com>
<OFFAFE93C3 DOT A0A9F63F-ON87257291 DOT 005FD04D-87257291 DOT 006003C4 AT seagate DOT com>
Reply-To: djgpp-workers AT delorie DOT com

On Thu, 01 Mar 2007 10:28:44 -0700, Gordon DOT Schumacher AT seagate DOT com wrote:

>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.

Your options are: keep the floating point, use the original integer
approximation, or change CLOCKS_PER_SEC and clock(). 

-- 
Thanks. Take care, Brian Inglis		Calgary, Alberta, Canada

- Raw text -


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