Search:
Forum
General C++ Programming
Measure execution time accurately
Measure execution time accurately
Nov 14, 2011 at 7:34am UTC
mohsaied
(15)
Hi all,
I am running some c++ code on linux and want to measure the exact amount of time it takes to run this code.
So far this has been working fine with the function clock.
1
2
3
4
5
double
start = clock();
//some code
cout <<
"execution time = "
<< clock() - start << endl;
HOWEVER! Now that I have pthreads in my code, this function returns completely wrong results. How can I measure execution time in a different way so that it accounts for that?
thanks.
Topic archived. No new replies allowed.
C++
Information
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs