The profiler contains helper functions in order to calculate how much time is elapsed ( Wall Clock Time ) for a given piece of code. Main modules of this library are as following
- time_start( label ) - Starting the measurement of execution time for the block starting with “label”
- time_end( label ) - End of the block initialized with time_start() function having the tag “label”
- total_time( ) - The total amount of time for all the blocks combines. Return type of this is float
- time_summary( ) - Total time for each individual execution block labelled
- elapsed_time( label ) - Total time of execution for the block having tag “label”
Just include the profile.c file in your code.
example.c is an exmaple piece of code that calculate the Fobinacci numbers from 1 to 43. In the end, time_summary is called to print all the modules with their corresponding wall clock times.
Note: This module doesn't take any different considerations for the Overlapping blocks