Re: speed of execution




pete wrote:
Nelu wrote:
where CLOCKS_PER_SEC equals 1000000 this function will return the
same value approximately every 72 minutes".
If this is the case, I hope his program doesn't need 72 minutes to
complete.
In that case he's better off using a stop watch :-).

... or maybe even a calendar.
.... whatever is more appropriate :-).


Is clock affected by other processes in a multitasking OS, or does it
count only when the CPU works on the calling process?

"the implementation's best approximation
to the processor time used by the program"

... which means
"only when the CPU works on the calling process"
except that
"other processes in a multitasking OS"
make the timing more complicated and possibly less accurate.
That's why I asked, because it can be difficult to time in a
multitasking
environment. I guess that's been taken care of in the man where it
says:
"The clock() function returns an approximation". I just didn't know
whether the "approximation" had to do with multitasking or it was
something related to the processor no matter what the environment was.

--
Ioan - Ciprian Tandau
tandau _at_ freeshell _dot_ org (hope it's not too late)
(... and that it still works...)

.