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 the PAPI_thread_init function. 😭
  • 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 return PAPI_ENOMEM or PAPI_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 πŸŽ€