The Boost Timer library answers the question "How long does my C++ code take to run?" and does so portably, with as little as one #include and one additional line of code.
Questions tagged [boost-timer]
8 questions
4
votes
1 answer
Measure CPU time spent on each thread separately in C++
I know that this question sounds like an easy question and a duplicate of former ones, in which boost.timer and the chrono facility of C++11 are given as answers.
But, what I have in mind is a bit different and I found no answer to it either on…

Jürgen Böhm
- 389
- 3
- 11
2
votes
2 answers
Segmentation fault on class destruction with boost::timer as a member of the class with periodic invocation
I'm working on a simple class which upon creation schedules a periodic timer for invoking one of its' methods. The method is virtual, so that derived classes can overload it with whatever periodic work they need.
In my test of this class, however, I…

peetonn
- 2,942
- 4
- 32
- 49
1
vote
1 answer
How to specify `boost::asio::yield_context` with timeout?
I would like to learn how to pass timeout timer to boost::asio::yield_context.
Let's say, in terms of Boost 1.80, there is smth like the following:
#include
#include
void…

unegare
- 2,197
- 1
- 11
- 25
1
vote
1 answer
How can I effectively use callbacks with boost::progress_display?
I would like to use callbacks with boost::progress_display. Firstly I have a class Foo that I need to broadcast events from:
class Foo
{
public:
template
void attachListener(L const &listener)
{
…

Ben J
- 1,367
- 2
- 15
- 33
0
votes
1 answer
How to instantiate the boost class `boost::posix_time::seconds` C++ class?
I found the following class definition in the boost library 1.71.0 which is installed at /usr/include/boost in my case.
class BOOST_SYMBOL_VISIBLE seconds : public time_duration
{
public:
template
…

Astra Uvarova - Saturn's star
- 677
- 2
- 9
- 25
0
votes
1 answer
Redirecting output of boost::timer::auto_cpu_timer
I'm widely using boost::timer::auto_cpu_timer to measure the execution time of different functions and code blocks. I'm using a macro to simplify its use at the time I can easily disable it in production:
#include
#include…

cbuchart
- 10,847
- 9
- 53
- 93
0
votes
1 answer
Aggregate wall time of code blocks in C++
I have a large codebase and I want to manually add some timers to profile some sections of the code.
Some of those sections are within a loop, so I would like to aggregate all the wall time spent there for each iteration.
What I'd like to do in a…

Andrea Zonca
- 8,378
- 9
- 42
- 70
0
votes
0 answers
Using Boost's timer (or any other timer) on windows in c++ to measure CPU time of external call to system
I've spent the last three days trying to find a solution to the following problem: I have a piece of code written in c++ in Microsoft Visual Studio 2010 from which I call some external executables, which are blackboxed to me, so I can't change their…

mkerikss
- 65
- 6