I have a program made up of several .h and .c files and a lot of functions. And there are functions which call other functions and so on. Now, this is actually an assignment so I know how much time the program needs to reach the end.
The problem is, my program takes too much time compared to the times I am given. Is it possible to find out which function is taking too much time or which part of the code is holding the program down?
I did not give the code here because it is too long. I know that no one can answer why "my program" is slow but I am talking in general! Is there a tool that measures how much time each function takes or something similar? I am using gcc and I'm on Linux.