|
PAPI
5.0.1.0
|

Go to the source code of this file.
Functions | |
| int | your_slow_code () |
| int | main () |
Variables | |
| int | i |
| double | tmp |
| int main | ( | ) |
Definition at line 23 of file PAPI_get_virt_cyc.c.
{
long long s,s1, e, e1;
int retval;
/****************************************************************************
* This part initializes the library and compares the version number of the *
* header file, to the version of the library, if these don't match then it *
* is likely that PAPI won't work correctly.If there is an error, retval *
* keeps track of the version number. *
****************************************************************************/
if((retval = PAPI_library_init(PAPI_VER_CURRENT)) != PAPI_VER_CURRENT )
{
printf("Library initialization error! \n");
exit(1);
}
/* Here you get initial cycles and time */
/* No error checking is done here because this function call is always
successful */
s = PAPI_get_virt_cyc();
your_slow_code();
/*Here you get final cycles and time */
e = PAPI_get_virt_cyc();
s1= PAPI_get_virt_usec();
your_slow_code();
e1= PAPI_get_virt_usec();
printf("Virtual cycles : %lld\nVirtual time(ms): %lld\n",e-s,e1-s1);
/* clean up */
PAPI_shutdown();
exit(0);
}

| int your_slow_code | ( | ) |
| int i |
Definition at line 10 of file PAPI_get_virt_cyc.c.
| double tmp |
Definition at line 11 of file PAPI_get_virt_cyc.c.