what is best way to measure computation time, with either STL C++ or Qt?
I know of ctime, but I have an idea Qt could be of use here.
Thanks!
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Theres the QTime class, that can measure time, you can start it via
start()and retrieve it via theelapsed()method.If you want something more advanced, you can go for Boost.Chrono if you want to get into serious time perversions. It gets real hairy real quick though, and the doc is a bit sparse (as always with Boost), but it’s really one of the cleanest and best libraries if you need something of that caliber.
It all depends on what you want to do though, because “measuring time of computation” is a very broad description. Do you actually want to profile your application? Then maybe a profiler tool might be more suitable.
Also, if you just want to get the raw time it takes to execute the program, there’s the
timecommand in Linux.