I am working on a server program written in C written as a procedural (not OO) code. Every method implements some specific functionality. For the diagnostics purpose I want to add code to a bunch of methods that will calculate and print the running time for the respective functions. It is on linux and I know how to calculate the running time.
My question is what would be the best, most efficient way to code this?
because it is a procedural code written in C I will have to add code to all the (about 20) functions for timer start, timer end and calculate the difference. Is there a better way than this ?