Go to the source code of this file.
◆ main()
int main |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
Definition at line 9 of file realtime.c.
10{
15
16
18
22 }
23
26 test_fail( __FILE__, __LINE__,
"PAPI_get_hardware_info", 2 );
27 }
28
30
32
34 printf( "Testing real time clock. (CPU Max %d MHz, CPU Min %d MHz)\n",
36 printf( "Sleeping for 10 seconds.\n" );
37 }
38
39 sleep( 10 );
40
42
44
47 printf( "%f Computed MHz.\n",
49 }
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
70 if (!
quiet) printf(
"NOTE: Elapsed real time less than 9 seconds (%lld us)!\n",
elapsed_us );
71 test_fail(__FILE__,__LINE__,
"Real time too short",1);
72 }
73
75 if (!
quiet) printf(
"NOTE: Elapsed real time greater than 11 seconds! (%lld us)\n",
elapsed_us );
76 test_fail(__FILE__,__LINE__,
"Real time too long",1);
77 }
78
79 if ( ( float ) elapsed_cyc < 9.0 * hw_info->cpu_max_mhz * 1000000.0 )
80 if (!
quiet) printf(
"NOTE: Elapsed real cycles less than 9*MHz*1000000.0!\n" );
82 if (!
quiet) printf(
"NOTE: Elapsed real cycles greater than 11*MHz*1000000.0!\n" );
83
85
86 return 0;
87}
static const PAPI_hw_info_t * hw_info
get information about the system hardware
get real time counter value in clock cycles Returns the total real time passed since some arbitrary s...
get real time counter value in microseconds
initialize the PAPI library.
int tests_quiet(int argc, char **argv)
void PAPI_NORETURN test_fail(const char *file, int line, const char *call, int retval)
void PAPI_NORETURN test_pass(const char *filename)