I'm doing a multi threaded work in c, and I need to calculate the time of a certain part of the program, does anyone have any idea how I can do this?
I'm doing a multi threaded work in c, and I need to calculate the time of a certain part of the program, does anyone have any idea how I can do this?
Yes, what you want to do has a name, it's called profiling . From a quick handy HERE to better understand what this technique means.
This is widely used to improve codes that need high performance, little used in real life programmer, but a very interesting technique to know.
Use the gprof tool to do this.
Good luck!