vpGetTimer(3)

πŸ“¦ version 1.0c7, in fedora 43, fedora 44

✨ vpGetTimer ✨

okay bestie, so this is a page from the Library Functions Manual about vpGetTimer(3) β€” aka the VolPack interval timer facility πŸ’… it's how you clock how long the library is spending doing stuff. let's get into it.


πŸŽ€ 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;
not me pointing out that stray double semicolon on int *iptr;; β€” it's literally in the original, i am NOT touching it, character for character, periodt πŸ’€

🌸 ARGUMENTS 🌸

  • vpc β€” the VolPack context, the one you got from vpCreateContext. your main character object fr 🫢
  • option β€” a constant that picks out which particular timer you're talking about.
  • iptr β€” the location where the timer value gets stored. it's a pointer, so it's writing into your int, no cap.

πŸ‘‘ DESCRIPTION πŸ‘‘

so these functions are for measuring the performance of the VolPack library. performance girlies rise 🧚

to use them, the library has to be compiled with a special flag, and you've got options:

  • -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. yes, additionally. both. don't forget the second one bestie 😭

if one of these flags is specified at compile time, then VolPack keeps a whole table recording the accumulated time spent in various operations. it's giving receipts πŸ“‹

⚠️ heads up: some of these operations can only be timed with a high-resolution timer. if a low resolution timer is specified at compile time, those time values will not be recorded and will appear to be zero. so don't be out here confused when your numbers are just 0, it's not you, it's the timer resolution πŸ’€

πŸ’– vpGetTimer πŸ’–

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

  • 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 one, it includes VPTIMER_CLSFY_OCTREE, VPTIMER_COMPOSITE, VPTIMER_DEPTHCUE, and VPTIMER_WARP. nested timers, we love a hierarchy πŸ’…
  • 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. another little family 🌈
  • 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. glow up stage ✨
  • 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.

the routine stores the accumulated time since the last call to vpClearTimer (or since the beginning of the program, if you never called it) in the location specified by iptr. the units of the value are microseconds. tiny units, big drama ⏱️

πŸ’œ vpClearTimer πŸ’œ

vpClearTimer sets the specified timer value back to zero. reset button, fresh start, new 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 passed something that isn't a real timer, bestie, and it said no πŸ™ˆ

🌟 SEE ALSO 🌟

VolPack(3), vpCreateContext(3)


and that's the whole page!! this one comes to you from VolPack, and yes the page itself is literally called vpGetTimer(3) β€” mwah, go measure something, ily, bye πŸ«ΆπŸ’–βœ¨

πŸ“¦ where this page comes from