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 Subject: Re: Final version of gettimeofday() patch In-reply-to: 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) Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 7bit References: 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 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