vpGetTimer(3)

πŸ’– vpGetTimer(3) β€” Library Functions Manual πŸ’–

okay bestie, gather round, because today we're talking about the interval timer facility in VolPack, and honestly? it's giving stopwatch energy. ⏱️✨


πŸŽ€ NAME πŸŽ€

vpGetTimer, vpClearTimer β€” interval timer facility


🌸 SYNOPSIS 🌸

#include <volpack.h>

vpResult
vpGetTimer(vpc, option, iptr)
    vpContext *vpc;
    int option;
    int *iptr;;

vpResult
vpClearTimer(vpc, option)
    vpContext *vpc;
    int option;

(yes the double semicolon is real, it's canon, we do not touch it πŸ’…)


πŸ¦‹ ARGUMENTS πŸ¦‹

  • vpc β€” the VolPack context, straight from vpCreateContext. your main character, your whole vibe.
  • option β€” a constant that says which timer we're talking about. pick your fighter.
  • iptr β€” the spot where the timer value gets stored. like, the lil jar we pour the number into. πŸ«™

✨ DESCRIPTION ✨

So these two functions are the performance measuring girlies of the VolPack library. they're how you find out how long stuff actually takes. but β€” and this is the important part β€” the library has to be compiled with a special flag first, otherwise this whole thing is not happening:

  • -DHAVE_LORES_TIMER β€” for machines that support the gettimeofday C library call
  • -DHAVE_HIRES_TIMER β€” for SGI machines that support high-resolution memory-mapped I/O timers; and on a Challenge or ONYX, you also have to specify -DHAVE_64BIT_TIMER

If one of those flags is given at compile time, then VolPack keeps a table recording the accumulated time spent in various operations. iconic. πŸ‘‘

⚠️ but listen β€” some of the operations can only be timed with a high-resolution timer. if you compiled with a low-resolution timer, those time values will not be recorded and will just appear as zero. not a bug, just the rules. πŸ’€

vpGetTimer retrieves the accumulated time for one particular operation. the option argument says which one:

  • VPTIMER_SHADE β€” times the routine that computes the contents of the shading lookup table.
  • VPTIMER_RENDER β€” times the routine that renders a volume. this one is the big mama: it includes VPTIMER_CLSFY_OCTREE, VPTIMER_COMPOSITE, VPTIMER_DEPTHCUE, and VPTIMER_WARP.
  • VPTIMER_COMPOSITE β€” times the routine that computes the intermediate image from the volume. includes VPTIMER_CLEAR, VPTIMER_TRAVERSE_OCTREE, VPTIMER_ERT, VPTIMER_TRAVERSE_RUNS, and VPTIMER_PROCESS_VOXELS.
  • VPTIMER_DEPTHCUE β€” times the routine that performs the depth cueing fixup on the intermediate image.
  • VPTIMER_WARP β€” times the routine that warps the intermediate image into the final image.
  • VPTIMER_TRAVERSE_RUNS β€” times the portion of the compositing routine devoted to traversing the volume data structures.
  • VPTIMER_PROCESS_VOXELS β€” times the portion of the compositing routine devoted to compositing voxels into the intermediate image.
  • VPTIMER_ERT β€” times the early-ray termination checks during compositing.
  • VPTIMER_CLSFY_OCTREE β€” times the octree classification stage.
  • VPTIMER_TRAVERSE_OCTREE β€” times the portion of the compositing routine devoted to traversing the octree.
  • VPTIMER_CLEAR β€” times the routine that clears the intermediate image at the beginning of compositing.

and then β€” the moment you've been waiting for β€” the routine stores the accumulated time since the last call to vpClearTimer (or since the beginning of the program, if you never called it) into the location specified by iptr. πŸ“ the units are microseconds. tiny units, big feelings.

vpClearTimer just sets the specified timer value back to zero. reset era. 🧼✨


πŸ’€ ERRORS πŸ’€

the normal return value is VP_OK. the following error return value is possible:

  • VPERROR_BAD_OPTION β€” the option argument is invalid. you gave it a fake timer, bestie, and it noticed. πŸ™ˆ

πŸ”₯ SEE ALSO πŸ”₯

VolPack(3), vpCreateContext(3)


that's the whole page, no notes, you're gonna time everything and it's gonna slay. this was vpGetTimer(3) from VolPack, and that's the vibe check passed with flying colors πŸ’–βœ¨πŸ¦‹πŸŽ€ β€” catch you in the next manpage, mwah. πŸ’…

πŸ“¦ where this page comes from