Re: [boost] Re: Re: Re: Boost Profiler Proposal

In-Reply-To: <001d01c50d76$7f669b20$d9958242@heronnest> cdiggins@videotron.ca (christopher diggins) wrote (abridged):
stop() and resume() are not part of the design.
You would write the above code as:
{ { basic_profiler<collecting_policy> p("profile1"); // some code } // some other code we do not want to profile { basic_profiler<collecting_policy> p("profile1"); // continue profiling } collecting_policy::generate_report(); } }
It seems to me the tail is wagging the dog here. The RAII class is no longer a helper but a hinderance that we have to work around. Your suggestion of adding block-scopes will not work if the first code declares variables that are used by the second block. For my own profiling I have a class which is effectively an array of timers, that can be stopped and started arbitrarily. RAII, when I need it, is a thin layer on top of that - but usually I don't need it. What I sometimes need instead is fairly sophisticated interactions between timers, eg starting one timer implicitly pausing the previous one. -- Dave Harris, Nottingham, UK
participants (1)
-
brangdon@cix.compulink.co.uk