PAPI 7.1.0.0
Loading...
Searching...
No Matches
PAPI_get_real_cyc.c File Reference
Include dependency graph for PAPI_get_real_cyc.c:

Go to the source code of this file.

Functions

int your_slow_code ()
 
int main ()
 

Function Documentation

◆ main()

int main ( )

Definition at line 21 of file PAPI_get_real_cyc.c.

22{
23 long long s,s1, e, e1;
24 int retval;
25
26
27 /****************************************************************************
28 * This part initializes the library and compares the version number of the *
29 * header file, to the version of the library, if these don't match then it *
30 * is likely that PAPI won't work correctly.If there is an error, retval *
31 * keeps track of the version number. *
32 ****************************************************************************/
33
35 {
36 printf("Library initialization error! \n");
37 exit(1);
38 }
39
40 /* Here you get initial cycles and time */
41 /* No error checking is done here because this function call is always
42 successful */
43
45
47
48 /*Here you get final cycles and time */
50
52
54
56
57 printf("Wallclock cycles : %lld\nWallclock time(ms): %lld\n",e-s,e1-s1);
58
59 /* clean up */
61
62 exit(0);
63}
int your_slow_code()
double s
Definition: byte_profile.c:36
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.
Finish using PAPI and free all related resources.
#define PAPI_VER_CURRENT
Definition: f90papi.h:54
int retval
Definition: zero_fork.c:53
Here is the call graph for this function:

◆ your_slow_code()

int your_slow_code ( )

Definition at line 10 of file PAPI_get_real_cyc.c.

11{
12 int i,tmp;
13
14 for(i=1; i<20000; i++)
15 {
16 tmp=(tmp+100)/i;
17 }
18 return 0;
19}
double tmp
int i
Here is the caller graph for this function: