libzypp  17.24.1
Measure.h
Go to the documentation of this file.
1 /*---------------------------------------------------------------------\
2 | ____ _ __ __ ___ |
3 | |__ / \ / / . \ . \ |
4 | / / \ V /| _/ _/ |
5 | / /__ | | | | | | |
6 | /_____||_| |_| |_| |
7 | |
8 \---------------------------------------------------------------------*/
12 #ifndef ZYPP_BASE_MEASURE_H
13 #define ZYPP_BASE_MEASURE_H
14 
15 #include <iosfwd>
16 #include <string>
17 
18 #include <zypp/base/PtrTypes.h>
19 
21 namespace zypp
22 {
23  namespace debug
25  {
26 
28  //
29  // CLASS NAME : Measure
30  //
68  class Measure
69  {
70  public:
72  Measure();
73 
75  explicit
76  Measure( const std::string & ident_r );
77 
79  ~Measure();
80 
84  void start( const std::string & ident_r = std::string() );
85 
87  void restart();
88 
92  void elapsed() const;
98  void elapsed( const std::string & tag_r ) const;
104  void elapsed( long tag_r ) const;
105 
107  void stop();
108 
109  private:
111  class Impl;
114  };
116 
118  } // namespace debug
121 } // namespace zypp
123 #endif // ZYPP_BASE_MEASURE_H
zypp::debug::Measure::_pimpl
RW_pointer< Impl > _pimpl
Pointer to implementation.
Definition: Measure.h:111
zypp::debug::Measure::stop
void stop()
Stop a running timer.
Definition: Measure.cc:236
PtrTypes.h
zypp::RW_pointer< Impl >
zypp::debug::Measure::~Measure
~Measure()
Dtor.
Definition: Measure.cc:220
zypp
Easy-to use interface to the ZYPP dependency resolver.
Definition: CodePitfalls.doc:1
zypp::debug::Measure::Measure
Measure()
Default Ctor does nothing.
Definition: Measure.cc:213
zypp::debug::Measure::start
void start(const std::string &ident_r=std::string())
Start timer for ident_r string.
Definition: Measure.cc:223
zypp::debug::Measure
Tool to measure elapsed real and process times.
Definition: Measure.h:68
zypp::debug::Measure::elapsed
void elapsed() const
Print elapsed time for a running timer.
Definition: Measure.cc:229
zypp::debug::Measure::restart
void restart()
re start the timer without reset-ing it.
Definition: Measure.cc:226
zypp::debug::Measure::Impl
Measure implementation.
Definition: Measure.cc:138