PAPI_get_virt_cyc(3)
β¨ NAME β¨
PAPI_get_virt_cyc β get virtual time counter value in clock cycles. yes bestie, this is the PAPI manual, and we are getting into the whole vibe π
π SYNOPSIS π
the synopsis is lowkey just a Doxygen hand-off: Detailed Description is right here, no separate args or flags listed. slay, moving on β¨
πΈ Detailed Description πΈ
okay so PAPI_get_virt_cyc returns the total number of virtual units from some arbitrary starting point. virtual units accrue every time the process is running in user-mode on behalf of the process. like the real time counters, this count is guaranteed to exist on every platform PAPI supports. however, on some platforms, the resolution can be as bad as 1/Hz as defined by the operating system. that's the tea β
π Return values π
PAPI_ECNFLCTβ if there is no master event set. This will happen if the library has not been initialized, or for threaded applications, if there has been no thread id function defined by thePAPI_thread_initfunction. πPAPI_ENOMEMβ for threaded applications, if there has not yet been any thread specific master event created for the current thread, and if the allocation of such an event set fails, the call will returnPAPI_ENOMEMorPAPI_ESYS. π
π¦ Examples π¦
s = PAPI_get_virt_cyc();
your_slow_code();
e = PAPI_get_virt_cyc();
printf("Process has run for cycles: %lld\en",e-s);
π«Ά AUTHOR π«Ά
Generated automatically by Doxygen for PAPI from the source code. (yes bestie, the docs wrote themselves, kinda iconic.)
mwah π this page is Version 7.2.0.0, dated Wed Jun 25 2025 19:30:48, for PAPI_get_virt_cyc(3) β bye lovelies π
π¦ where this page comes from
- nixos 26.05: papi 7.2.0
- nixpkgs unstable: papi 7.2.0
- opensuse-leap 16.0: papi-devel 7.2.0-160000.2.2 Β· BSD-3-Clause
- opensuse-leap 16.0: papi-devel 7.2.0-160000.2.2 Β· BSD-3-Clause
- opensuse-leap 16.0: papi-devel 7.2.0-160000.2.2 Β· BSD-3-Clause
- ubuntu resolute: libpapi-dev 7.2.0-2 Β· BSD-3-Clause
- ubuntu stonking: libpapi-dev 7.2.0-2 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms