1 |
#ifdef TARGET_LINUX |
2 |
#undef FORTRAN_MANGLE_TRAILING_UNDERSCORE |
3 |
#else |
4 |
#define FORTRAN_MANGLE_TRAILING_UNDERSCORE |
5 |
#endif |
6 |
#define TIM_USES_GETTIMEOFDAY |
7 |
|
8 |
#ifdef FORTRAN_MANGLE_TRAILING_UNDERSCORE |
9 |
#define procedure_cloc cloc_ |
10 |
#else |
11 |
#define procedure_cloc cloc |
12 |
#endif |
13 |
#ifdef TIM_USES_OSF_GETCLOCK |
14 |
#include <stdio.h> |
15 |
#include <stdlib.h> |
16 |
#include <unistd.h> |
17 |
#include <assert.h> |
18 |
#include <sys/time.h> |
19 |
void procedure_cloc ( double *curtim ) |
20 |
{ |
21 |
struct timespec tv1; |
22 |
getclock(TIMEOFDAY, &tv1); |
23 |
*curtim = (double)((tv1.tv_nsec)+(tv1.tv_sec)*1.E9); |
24 |
*curtim = *curtim/1E9; |
25 |
} |
26 |
#endif |
27 |
#ifdef TIM_USES_GETTIMEOFDAY |
28 |
#include <stdio.h> |
29 |
#include <stdlib.h> |
30 |
#include <unistd.h> |
31 |
#include <assert.h> |
32 |
#include <sys/time.h> |
33 |
void procedure_cloc ( double *curtim ) |
34 |
{ |
35 |
struct timeval tv1; |
36 |
gettimeofday(&tv1 , (void *)NULL ); |
37 |
*curtim = (double)((tv1.tv_usec)+(tv1.tv_sec)*1.E6); |
38 |
*curtim = *curtim/1.E6; |
39 |
|
40 |
} |
41 |
#endif |
42 |
|