how to calculate processing time in milliseconds

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
In windows, I like to use
QueryPerformanceCounter and QueryPerformanceFrequency

http://msdn.microsoft.com/en-us/library/windows/desktop/ms644904(v=vs.85).aspx
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
high_resolution_clock from C++ (http://en.cppreference.com/w/cpp/chrono )


That's Awesome.
The clocks in <chrono> are wall clocks; they deal with elapsed time.
Thanks a lots,,,
Topic archived. No new replies allowed.