| kwnan (6) | |
|
I want to calculate processing time in milliseconds as most of function I found give me in second. I am new user to C++, the code will be running under linux. Regards | |
|
|
|
| ChrisH (3) | |
|
In windows, I like to use QueryPerformanceCounter and QueryPerformanceFrequency http://msdn.microsoft.com/en-us/library/windows/desktop/ms644904(v=vs.85).aspx | |
|
|
|
| Cubbi (1927) | |
with Linux, you have many options:high_resolution_clock from C++ (http://en.cppreference.com/w/cpp/chrono )microsec_clock from boost (http://www.boost.org/doc/libs/release/doc/html/date_time/posix_time.html )clock_gettime from POSIX (http://pubs.opengroup.org/onlinepubs/9699919799/functions/clock_getres.html )and probably something linux-specific, too. There's also the commandline utility and the shell builtin time which measures wall time, CPU time, and system time spent by a given application.
| |
|
Last edited on
|
|
| majidkamali1370 (226) | ||
That's Awesome. | ||
|
|
||
| JLBorges (1754) | |
The clocks in <chrono> are wall clocks; they deal with elapsed time.
| |
|
|
|
| kwnan (6) | |
| Thanks a lots,,, | |
|
|
|