I'm trying to measure the CPU time for functions within my C++ program. I am doing this using the boost library. When I run my program however I get a result of 0 seconds. I'm new to boost so if someone could point me in the right direction?
How can I make this return a time that I can actually use, such as 0.00156 or something?
Code: Inside main()
boost::timer::cpu_timer timer;
std::cout << tree1.search("Cork") << std::endl;
//Print CPU TIME
boost::timer::cpu_times elapsed = timer.elapsed();
std::cout << " CPU TIME: " << (elapsed.user + elapsed.system) / 1e9 << " seconds" << std::endl;