At 05:12 PM 2/27/96 +0100, peter van boheemen wrote:
>Is there anybody out there who can help me solve the following
>problem.
>I want to log the cpu-time spend searching a data base.
>I looked at the PROCTIME intrinsic, but this will only tell me
>how much CPU time is spend in the current process. In this case
>the user-interface is launching sub processes to do the searches.
>Then I tried to get hold of the HPCPUSECS variable, before and
>after the search and log the difference. I got strange results, so
>I checked the manuals and noticed that HPCPUSECS, if retrieved from
>the CI process, will return the number of cpusecs consumed during
>the entire session, but if retrieved from any other process it will
>return the cpusecs spend in that current process. (silly, isn't it)
>Now I am lost.
 
To obtain process time of a sub-process would require the use of PM, and the
AIF procedure.  The parent process would also have to know when it is
appropriate to obtain the process time for a sub-process (which obviously
increases the complexity of the task...)
 
A much simplier approach would be to have each sub-process do a PROCTIME
before and again after the search, compute the difference and report it or
pass it back to the father (msg file possible).
 
When I've incorporated timing or debugging steps in code I've used a
compliler switch to enable/disable inclusion of the code as a part of a
conditional compilation.  You might consider this if you don't need this
data all the time.  When you're in full production you may not want to incur
the constant overhead associated with this data....
 
 
-- Jerry