*****************************************************************************
* CTC++, Test Coverage Analyzer for C/C++, Version 7.0 *
* *
* EXECUTION TIME LISTING *
* *
* Copyright (c) 1993-2011 Testwell Oy *
*****************************************************************************
Symbol file(s) used : MON.sym (Fri Jul 01 08:22:06 2011)
Data file(s) used : MON.dat (Fri Jul 01 08:23:00 2011)
Listing produced at : Fri Aug 05 08:40:13 2011
Execution cost type : Clock ticks
MONITORED SOURCE FILE : prime.c
INSTRUMENTATION MODE : multicondition+inclusive_timing
EXECUTION =======EXECUTION COST========
COUNT TOTAL AVERAGE MAX LINE FUNCTION
=============================================================================
2 33957 16978.5 17541 8 main()
MONITORED SOURCE FILE : io.c
INSTRUMENTATION MODE : multicondition+inclusive_timing
EXECUTION =======EXECUTION COST========
COUNT TOTAL AVERAGE MAX LINE FUNCTION
=============================================================================
8 33953 4244.1 9217 5 io_ask()
6 4 0.7 1 18 io_report()
MONITORED SOURCE FILE : calc.c
INSTRUMENTATION MODE : multicondition+inclusive_timing
EXECUTION =======EXECUTION COST========
COUNT TOTAL AVERAGE MAX LINE FUNCTION
=============================================================================
6 0 0.0 0 4 is_prime()
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 function io_ask(), where the user's input was waited, explains practically all of the program execution time.
This example has been run with a program, which is instrumented for inclusive timing. If exclusive timing instrumentation had been used, we would have seen that practically only function io_ask() would have got any time measurements. And function main() would have been close to zero, because the time spent in the instrumented functions that it calls are excluded from its timing values.
Here the default CTC++ settings have been in effect and the time is displayed 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.