RE: [boost] Re: high_resolution_timer \ timer feature requestsfor Boost.Timer

I am generally doing the following- Solving my specific problem for my specific application. After I am through with that issue, I will look more at the general issues (as I ended up inheriting the profiler). For my APP- I am logging in hierarchical form the timings-(in addition to the report the profiler already does) so if you have (code is high level and pseudo) FuncB() { PROFILE POINT FUNCTION B { Sleep(1000); // 1 second } } FuncA() { PROFILE POINT FUNCTION B { Sleep(1000); // 1 second FuncB(); } } Then you will have in the profile Report (overall): FuncA took 2 seconds FuncB took 1 second But the Profile LOG (like a trace of what happened) looks like this DEPTH NAME TIME 0 FuncA 2 Seconds 1 FuncB 1 Second Does that answer your question, or am I missing something?
-----Original Message----- From: boost-bounces@lists.boost.org [mailto:boost-bounces@lists.boost.org] On Behalf Of Goran Mitrovic Sent: Friday, March 04, 2005 12:21 AM To: boost@lists.boost.org Subject: [boost] Re: high_resolution_timer \ timer feature requestsfor Boost.Timer
How do you intent to deal with nested timers (outer ones might become very inaccurate because of the inner ones)?
Also, how do you plan to represent results of such profiling?
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

On Fri, 4 Mar 2005 10:42:16 -0700, Brian Braatz <brianb@rmtg.com> wrote:
But the Profile LOG (like a trace of what happened) looks like this DEPTH NAME TIME 0 FuncA 2 Seconds 1 FuncB 1 Second
Does that answer your question, or am I missing something?
Just a subtle point, but the boost::timer class returns CPU time used not elapsed wall-clock time and would return results of ~0.0 for a function that just sleep'd for a second or two. If what you're looking for is a high-resolution clock, try <boost/date_time/microsec_time_clock.hpp> (at least in the latest CVS). If you want performance or profiling information, use boost::timer. -- Caleb Epstein caleb dot epstein at gmail dot com
participants (2)
-
Brian Braatz
-
Caleb Epstein