Skip to main content

This article explains that the COBOL Profiler tracks CPU time rather than elapsed wall clock time.

Problem:

Does the Profiler keep track of elapsed (wall clock) time? When using the Profiler to measure performance, I see that the total time it reports is less than the total elapsed time for the program, based on the time of day.

Resolution:

The COBOL profiler does not keep track of elapsed (wall clock) time, instead it tracks CPU time. Several sources of elapsed time will be left out of a profiler report: it does not keep track of time waiting for user input, neither does it track time when the process has spawned a child and is waiting for the child to return, nor does it report elapsed time in calls to databases.

Attached to this Knowledgebase article is a demo useful for testing Profiler's behavior. The demo tests Profiler when:
  1. Waiting for user input in a COBOL program
  2. When a CPU-intensive C routine is called
  3. When COBOL calls "SYSTEM" using a sleep command
  4. When COBOL itself does some CPU-intensive number crunching

You can modify the file "myconfig" to change Profiler's behavior to "0" or "1". This changes the way CPU time is reported in subprograms versus parent programs.

Also included is example COBOL code that can capture the system (wall clock) time at different intervals and compute elapsed time manually.

Old KB# 14012

This article explains that the COBOL Profiler tracks CPU time rather than elapsed wall clock time.

Problem:

Does the Profiler keep track of elapsed (wall clock) time? When using the Profiler to measure performance, I see that the total time it reports is less than the total elapsed time for the program, based on the time of day.

Resolution:

The COBOL profiler does not keep track of elapsed (wall clock) time, instead it tracks CPU time. Several sources of elapsed time will be left out of a profiler report: it does not keep track of time waiting for user input, neither does it track time when the process has spawned a child and is waiting for the child to return, nor does it report elapsed time in calls to databases.

Attached to this Knowledgebase article is a demo useful for testing Profiler's behavior. The demo tests Profiler when:
  1. Waiting for user input in a COBOL program
  2. When a CPU-intensive C routine is called
  3. When COBOL calls "SYSTEM" using a sleep command
  4. When COBOL itself does some CPU-intensive number crunching

You can modify the file "myconfig" to change Profiler's behavior to "0" or "1". This changes the way CPU time is reported in subprograms versus parent programs.

Also included is example COBOL code that can capture the system (wall clock) time at different intervals and compute elapsed time manually.

Old KB# 14012

PROFILER-DEMO.zip