*****************************************************************************
* CTC++, Test Coverage Analyzer for C/C++, Version 6.5 *
* *
* EXECUTION TIME LISTING *
* *
* Copyright (c) 1993-2008 Testwell Oy *
*****************************************************************************
Symbol file(s) used : MON.sym (Thu Feb 07 13:59:53 2008)
Data file(s) used : MON.dat (Thu Feb 07 14:03:02 2008)
Listing produced at : Mon Feb 11 12:40:11 2008
Execution cost type : Clock ticks
MONITORED SOURCE FILE : calc.c
INSTRUMENTATION MODE : function-decision-multicondition-timing
EXECUTION EXECUTION COST
COUNT TOTAL AVERAGE LINE FUNCTION/TIMER
=============================================================================
3 0 0.0 4 is_prime()
MONITORED SOURCE FILE : io.c
INSTRUMENTATION MODE : function-decision-multicondition-timing
EXECUTION EXECUTION COST
COUNT TOTAL AVERAGE LINE FUNCTION/TIMER
=============================================================================
4 16583 4145.8 5 io_ask()
3 0 0.0 18 io_report()
MONITORED SOURCE FILE : prime.c
INSTRUMENTATION MODE : function-decision-multicondition-timing
EXECUTION EXECUTION COST
COUNT TOTAL AVERAGE LINE FUNCTION/TIMER
=============================================================================
1 0 0.0 8 main()
By default CTC++ uses clock() from <time.h> as the function by which the timing is taken. This example has been run in a PC and the clock granularity has been so poor that only the function io_ask(), where user's input was waited, has got any time measured in it. Here the default CTC++ settings have been in effect and the time is diplayed as "Clock ticks". There would be means to scale the timing values, here for example divide the values with 1000 and get the timing in "Seconds".
Instead clock() you can introduce your own function (better granularity, describes better the function execution cost,...) and ask CTC++ to use that in time measurements.
The above example has be run under so called Exclusive_Timing setting. It means that from the time cumulated to the caller (instrumented) function it is excluded the time spent in the called (instrumented) function. You could also have made the instrumenting with so called Inclusive_Timing setting. Then you would have seen that main() function time would have contained also the time spent in all of the (instrumented) functions it called.