www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/02/28/07:09:53

Date: Wed, 28 Feb 1996 12:52:58 +0100 (MET)
From: erik AT tntnhb3 DOT tn DOT tudelft DOT nl (Erik Luijten)
Subject: Re: time measurement in protected mode?
In-reply-to: <Pine.SUN.3.91.960228114506.11954C-100000@is>
To: eliz AT is DOT elta DOT co DOT il (Eli Zaretskii)
Cc: djgpp AT delorie DOT com (djgpp)
Message-id: <9602281152.AA20955@tntnhb3.tn.tudelft.nl>

Eli Zaretskii wrote:
> 
> You'll have to provide more details to get meaningful answers to your 
> question.  If you only want to time various functions, you can simply 
> compile it with -pg switch and use `gprof' to generate a report after 
> the program exits.  If this is a feature that you must use while the 
> program runs, please tell to what accuracy do you need to measure time.

Thank you for your answer.
I do know about profiling, but now it must be a feature of the program.
The accuracy does not have be too high: one second would be ok, 0.01 second
would be perfect.

> It is enough to time for 24 hours without wrapping around (but it measures
> relative to the time the program started, so it will wrap about 24 hours
> after the program started, not at midnight).  For larger time periods
> (really, for anything that lasts as long as a few hours), you should use
> the `gettimeofday' library function. 

Why do you say: for anything as long as a few hours, if clock() only wraps
after ca. 24 hours?
gettimeofday() seems ok, but doesn't it require a switch to real mode?
If so, is there any other timer function (resolution see above)  which does
not require this switch?

Erik


- Raw text -


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