It is often useful to know how many times each statement in a program has been
executed. Such information may reveal logical errors and can often help in
tracing the execution path in the event of a run-time failure. It will also
indicate which parts of a program are most heavily used so that those parts can
be examined and recoded to improve execution speed should this be considered
worthwhile. Profiling has a further use in ensuring that test data
exercises all parts of a program.
Profiling is only available for a Win32 platform. For some .NET
programs you can temporarily change to Win32 in order to make use of this
Profiling is enabled by using the FTN95 command line option
/PROFILE. Once profiling is enabled each executable statement is
compiled so that a count is kept at run-time of the number of times that
statement is executed.
Profiling information is viewed from the debugger SDBG so it is necessary
to compile the program using one of the debugging options (e.g. /DEBUG or
/CHECKMATE). When you run the program using SDBG (either to a break point or to
completion), the number of times each line of code is executed appears in
a column on the right hand side of the code window.
SDBG can be launched from the command line (see
Invoking SDBG) or from Visual Studio by selecting Debug
and then Start from the main menu.