Example of CTC++ Execution Time Listing

*****************************************************************************
*           CTC++, Test Coverage Analyzer for C/C++, Version 8.2            *
*                                                                           *
*                          EXECUTION TIME LISTING                           *
*                                                                           *
*                    Copyright (c) 1993-2013 Testwell Oy                    *
*             Copyright (c) 2013-2017 Verifysoft Technology GmbH            *
*****************************************************************************

Symbol file(s) used   : MON.sym (Tue Apr 11 13:56:19 2017)
Data file(s) used     : MON.dat (Tue Apr 11 13:56:36 2017)
Listing produced at   : Tue Apr 11 14:02:43 2017
Execution cost type   : Clock ticks
 
MONITORED SOURCE FILE : F:\ctcwork\v81\doc\examples\prime.c
INSTRUMENTATION MODE  : multicondition+inclusive_timing
 EXECUTION      =======EXECUTION COST========
     COUNT      TOTAL      AVERAGE        MAX  LINE FUNCTION
=============================================================================
         1      20405      20405.0      20405     8 main()
 
MONITORED SOURCE FILE : F:\ctcwork\v81\doc\examples\io.c
INSTRUMENTATION MODE  : multicondition+inclusive_timing
 EXECUTION      =======EXECUTION COST========
     COUNT      TOTAL      AVERAGE        MAX  LINE FUNCTION
=============================================================================
         4      20405       5101.3       8424     5 io_ask()
         3          0          0.0          0    18 io_report()
 
MONITORED SOURCE FILE : F:\ctcwork\v81\doc\examples\calc.c
INSTRUMENTATION MODE  : multicondition+inclusive_timing
 EXECUTION      =======EXECUTION COST========
     COUNT      TOTAL      AVERAGE        MAX  LINE FUNCTION
=============================================================================
         3          0          0.0          0     4 is_prime() 

By default CTC++ does not instrument the code for timing. But when it is selected, it is either inclusive (like here) or exclusive. In inclusive timing the function's time contains all the time spent in the function and in the functions that it had called. In exclusive timing CTC++ extracts from the function's time the time that was spent in those instrumented functions that the function had called.

This examples is in line with other examples in these HTML pages. Four inputs (2, 5, 20, 0) were given to the program. In total the prorgam execution took about 20 seconds. All measured time was spent in waiting the keyboard input in function io_ask(). At windows the system function clock() granularity is so poor that it did not advance during the execution of the other functions.

Instead of clock() you can introduce your own time-taking function (better granularity, describes better the function execution cost,...) and ask CTC++ to use that in time measurements.