20#include <zypp/base/Logger.h>
22#include <zypp/base/String.h>
26#undef ZYPP_BASE_LOGGER_LOGGROUP
27#define ZYPP_BASE_LOGGER_LOGGROUP "Measure"
54 ret._proc.tms_utime -= rhs.
_proc.tms_utime;
55 ret._proc.tms_stime -= rhs.
_proc.tms_stime;
56 ret._proc.tms_cutime -= rhs.
_proc.tms_cutime;
57 ret._proc.tms_cstime -= rhs.
_proc.tms_cstime;
103 time_t
h = time_t(
sec_r)/3600;
105 time_t
m = time_t(
sec_r)/60;
130 return str <<
obj.asString();
183 std::ostream &
log()
const
196 if ( !
tag_r.empty() )
198 return str_r << endl;
Reference counted access to a Tp object calling a custom Dispose function when the last AutoDispose h...
void reset()
Reset to default Ctor values.
std::ostream & log() const
Return the log stream.
std::ostream & dumpMeasure(std::ostream &str_r, const std::string &tag_r=std::string()) const
static std::string _glevel
std::ostream * logp() const
void elapsed(const std::string &tag_r=std::string()) const
Impl & operator=(Impl &&)=delete
Impl(std::string &&ident_r, std::ostream *log_r=nullptr)
Impl(const Impl &)=delete
Impl & operator=(const Impl &)=delete
Measure()
Default Ctor does nothing.
void elapsed() const
Print elapsed time for a running timer.
void stop()
Stop a running timer.
void restart()
re start the timer without reset-ing it.
RW_pointer< Impl > _pimpl
Pointer to implementation.
void start(std::string ident_r=std::string())
Start timer for ident_r string.
String related utilities and Regular expression matching.
std::ostream & operator<<(std::ostream &str, const Tm &obj)
\refers Tm Stream output.
std::string form(const char *format,...) __attribute__((format(printf
Printf style construction of std::string.
Easy-to use interface to the ZYPP dependency resolver.
std::string asString(const Patch::Category &obj)
Times measured by Measure.
std::string stringIf(clock_t ticks_r, const std::string &tag_r) const
time_t _real
Real time via ::time.
std::string timeStr(double sec_r) const
struct tms _proc
Process times via ::times.
std::string asString() const
static const long ticks
Systems ticks per second.
Tm operator-(const Tm &rhs) const
std::string timeStr(time_t sec_r) const
double asSec(clock_t ticks_r) const