How Quantify records function time

Quantify starts a counter each time a function is called and counts the number of machine cycles that the function call requires, exclusive of any other function calls it makes. When the function exits and returns to its caller, Quantify records the counted time. Quantify also tracks the minimum and maximum function times recorded for each function. This is useful, for example, if the function performs initialization only on the first call, not on subsequent calls.

To track the callers of each function, Quantify inserts code at all function entry and exit points in your program. As the program runs, Quantify maintains a parallel stack of function calls that accumulates information about each function call. This stack is used to determine the descendants of each function.

When the function exits, Quantify distributes the accumulated function+descendants time to the function's immediate caller as part of the calling function's descendant counts. This data is shown in the Call Graph and Function Detail windows.

Quantify uses .root. as an accumulator for the total time consumed by all the functions in the program. Quantify treats .root. as a function and considers all the functions in the program to be descendents of .root.

Quantify reports any signal handlers as descendants of .root. in the pure_sigtramp subtree.

Quantify does not double count a function's time when the function calls itself directly, as in the case of a recursive function, or indirectly through other functions. It never records counts for such functions in the function time accumulator as well as in the function's descendants count. In Quantify, a function is never its own descendant. A function's descendants' time report reflects the time spent in all functions it called exclusive of calls to itself. For more information, read How Quantify handles recursive functions.