Mail Archives: djgpp-workers/2007/03/02/03:24:46
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 -