vpGetTimer(3)
β¨ 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 fromvpCreateContext. 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 thegettimeofdayC 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 π
- and on a Challenge or ONYX, you also have to specify
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 includesVPTIMER_CLSFY_OCTREE,VPTIMER_COMPOSITE,VPTIMER_DEPTHCUE, andVPTIMER_WARP. nested timers, we love a hierarchy πVPTIMER_COMPOSITEβ times the routine that computes the intermediate image from the volume. includesVPTIMER_CLEAR,VPTIMER_TRAVERSE_OCTREE,VPTIMER_ERT,VPTIMER_TRAVERSE_RUNS, andVPTIMER_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β theoptionargument 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
- fedora 43: volpack 1.0c7-35.fc43 Β· BSD-3-Clause
- fedora 43: volpack 1.0c7-35.fc43 Β· BSD-3-Clause
- fedora 44: volpack 1.0c7-36.fc44 Β· BSD-3-Clause
- fedora 44: volpack 1.0c7-36.fc44 Β· BSD-3-Clause
- Copyright (c) 1995-2008, Stanford University
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms