libzypp 17.31.23
|
Tool to measure elapsed real and process times. More...
#include <base/Measure.h>
Classes | |
class | Impl |
Measure implementation. More... | |
Public Member Functions | |
Measure () | |
Default Ctor does nothing. | |
Measure (const std::string &ident_r) | |
Ctor taking ident_r string and auto starts timer. | |
Measure (const std::string &ident_r, std::ostream &out_r) | |
~Measure () | |
Dtor. | |
void | start (const std::string &ident_r=std::string()) |
Start timer for ident_r string. | |
void | restart () |
re start the timer without reset-ing it. | |
void | elapsed () const |
Print elapsed time for a running timer. | |
void | elapsed (const std::string &tag_r) const |
void | elapsed (long tag_r) const |
void | stop () |
Stop a running timer. | |
Private Attributes | |
RW_pointer< Impl > | _pimpl |
Pointer to implementation. | |
Tool to measure elapsed real and process times.
Timer is started by either passing a string to the ctor, or callign start. The string passed is printed on all messages to help identifying the timer.
Elapsed time is printed on calling elapsed (timer keeps running) or stop.
Calling stop, stops the timer. The same, if the timer goes out of scope.
Elapsed time is printed as:
In brackets the time elapsed since a previous call to elapsed. All units are seconds.
zypp::debug::Measure::Measure | ( | ) |
Default Ctor does nothing.
Definition at line 218 of file Measure.cc.
|
explicit |
Ctor taking ident_r string and auto starts timer.
Definition at line 221 of file Measure.cc.
zypp::debug::Measure::Measure | ( | const std::string & | ident_r, |
std::ostream & | out_r | ||
) |
Definition at line 225 of file Measure.cc.
zypp::debug::Measure::~Measure | ( | ) |
Dtor.
Definition at line 229 of file Measure.cc.
void zypp::debug::Measure::start | ( | const std::string & | ident_r = std::string() | ) |
Start timer for ident_r string.
Implies stoping a running timer.
Definition at line 232 of file Measure.cc.
void zypp::debug::Measure::restart | ( | ) |
re start the timer without reset-ing it.
Definition at line 235 of file Measure.cc.
void zypp::debug::Measure::elapsed | ( | ) | const |
Print elapsed time for a running timer.
Timer keeps on running.
Definition at line 238 of file Measure.cc.
void zypp::debug::Measure::elapsed | ( | const std::string & | tag_r | ) | const |
Definition at line 240 of file Measure.cc.
void zypp::debug::Measure::elapsed | ( | long | tag_r | ) | const |
Definition at line 242 of file Measure.cc.
void zypp::debug::Measure::stop | ( | ) |
Stop a running timer.
Definition at line 245 of file Measure.cc.
|
private |