Boost logo

Boost :

From: Valentin Bonnard (Bonnard.V_at_[hidden])
Date: 1999-07-03 21:26:26


I can implement timer on the Macintosh.

The MacOS gives ms times with an error of 20 ms
(at least in theory).

Perhaps there should be a

double inaccuracy () const
{ return 1/CLOCKS_PER_SECOND; }
// usually 1/60

function to return the estimated inaccuracy.

Perhaps this should be configurationed.

After writing this message, I have tried the
following:

#include <time.h>
#include <stdio.h>

int main()
{
printf ("CLOCKS_PER_SEC = %ld\n", (long) CLOCKS_PER_SEC);
for (;;)
{
clock_t t = clock ();
while (t == clock ());
printf ("Difference = %ld\n", (long) (clock() - t));
}
return 0;
}

which gives

CLOCKS_PER_SEC = 1000000
Difference = 10000
Difference = 10000
...

on

SunOS brick 5.5 Generic_103093-14 sun4u sparc SUNW,Ultra-1

-- 
Valentin Bonnard
------------------------------------------------------------------------
eGroups.com home: http://www.egroups.com/group/boost
http://www.egroups.com - Simplifying group communications

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk