38 |
{ |
{ |
39 |
static clock_t ref; |
static clock_t ref; |
40 |
static double dref; |
static double dref; |
|
static double dcps; |
|
41 |
clock_t now; |
clock_t now; |
42 |
double dnow; |
double dnow; |
43 |
|
|
44 |
if( f_first ) { |
if( f_first ) { |
|
dcps = (double) CLOCKS_PER_SEC; |
|
45 |
ref = clock(); |
ref = clock(); |
46 |
dref = (double) ref; |
dref = (double) ref; |
47 |
f_first = FALSE; |
f_first = FALSE; |
49 |
now = clock(); |
now = clock(); |
50 |
dnow = (double) now; |
dnow = (double) now; |
51 |
|
|
52 |
return( (dnow - dref)/dcps ); |
return((dnow - dref)/CLOCKS_PER_SEC); |
53 |
} |
} |
54 |
|
|
55 |
double tm_reset_cpu_time(void) |
double tm_reset_cpu_time(void) |