Mail Archives: djgpp/1996/02/28/07:09:53
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 -