On Thu, 07 Jan 2010, Szak�ts Viktor wrote:

Hi,

> We have hb_secondsCPU() in core, maybe code below could be 
> incorporated into it.

It's not exactly the same.
If possible (supported bu OS) hb_secondsCPU() returns number CPU
cycles consumed by programs not real time clock. It means that

   d = hb_secondsCPU();
   Sleep( 10 );
   d = hb_secondsCPU() - d;

should give value close to 0.0 because inside Sleep( 10 ) process
is suspended by OS and do not consume CPU at all.

I think that we should add new function to extract real time clock
with high precision. Because precision can be different on different
OS-es then we will have to chose holder which allow to set different
precision. We can use 2 integer numbers for that or single double
number (floating point number are internally divided to mantissa and
exponent what gives us the functionality we are looking for)
Mindaugas used double value in his example and it's reasonable for me.
The return value from such function can be used only to measure some
real time differences because in portable programs it's undefined,
i.e. in Mindaugas'es code it's the time of 1-st call to this function.
I'll add such function ASAP.

best regards,
Przemek
_______________________________________________
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour

Reply via email to