There are some ways to measure the executing running time of a function in C++.
Use time() in ctime. However, be aware that clock() measures CPU time, not actual time elapsed (which may be much greater).
With C++11 and the help of a class template and lambda functions (when needed) you could abstract the time measuring mechanism. Then each callable would have its run time measured with minimal extra code, just by being called throught the measure structure. Plus, at compile time you can parametrize the time type (milliseconds, nanoseconds etc)