HPL_timer_cputime(3)

πŸ“¦ version 2.2, in fedora 43, fedora 44

✨ HPL_timer_cputime(3) ✨

okay bestie, welcome to the HPL Library Functions page for HPL_timer_cputime(3). this is the one that hands you the CPU time, and we're gonna get into it πŸ’…


πŸ’– NAME πŸ’–

HPL_timer_cputime β€” Return the CPU time.


πŸ¦‹ SYNOPSIS πŸ¦‹

#include "hpl.h"

double HPL_timer_cputime();

πŸ’… DESCRIPTION πŸ’…

so like, HPL_timer_cputime returns the cpu time. that's the whole vibe. but the way it gets that cpu time depends on which macro is defined, and honestly the tea is kinda iconic:

  • If HPL_USE_CLOCK is defined, the clock() function is used to return an approximation of processor time used by the program. The value returned is the CPU time used so far as a clock_t; to get the number of seconds used, the result is divided by CLOCKS_PER_SEC. This function is part of the ANSI/ISO C standard library.
  • If HPL_USE_TIMES is defined, the times() function is used instead. This function returns the current process times. times() returns the number of clock ticks that have elapsed since the system has been up.
  • Otherwise and by default, the standard library function getrusage() is used.

no cap, that's the whole rundown 🫢


🌸 SEE ALSO 🌸

  • HPL_timer_walltime (3)
  • HPL_timer (3)

mwah πŸ’– this page was HPL 2.2, dated February 24, 2016, and the footer lowkey says HPL_timer_cputime(3). slay ✨

πŸ“¦ where this page comes from