On Fri, 2002-08-30 at 19:49, Mike Bresnahan wrote:
> Thanks, Chris.  My concern with using gettimeofday() is that I don't want to
> pay the performance cost of doing a timezone calculation.  In fact I don't
> require the real time.  I simply want to measure the elapsed time of an
> operation.  A simple counter running at the clock frequency of the processor
> would suffice; as long as I can also determine the clock frequency.  I
> understand that the pentium processor has such a function and it requires
> only a small amount of assembly code to access it, however I'd prefer to not
> write the assembly code if I don't have to.

What timezone calculation?  As near as I can tell, gettimeofday returns
the time in UTC, which is what the kernel keeps its time in.

If your application is so sensitive that the overhead of a system call
is too much, then I don't know what to say.  It sounds like the hand
hacked bit of assembly is really your only choice.  Even that is fraught
with peril in the form of kernel timer scheduling interrupts and
possibly even another process running while you're trying to do your
timing.

Have fun (if at all possible),
-- 
The best we can hope for concerning the people at large is that they
be properly armed.  -- Alexander Hamilton
-- Eric Hopper (hopper at omnifarious.org 
http://www.omnifarious.org/~hopper) --
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 228 bytes
Desc: This is a digitally signed message part
Url : http://shadowknight.real-time.com/pipermail/tclug-devel/attachments/20020831/70aa09b2/attachment.pgp