#include <benchmark.hpp>
Definition at line 79 of file benchmark.hpp.
◆ CpuClock()
cybozu::CpuClock::CpuClock |
( |
| ) |
|
|
inline |
Definition at line 84 of file benchmark.hpp.
84: clock_(0), count_(0) { t_.setTime(0, 0); }
◆ begin()
void cybozu::CpuClock::begin |
( |
| ) |
|
|
inline |
Definition at line 85 of file benchmark.hpp.
86 {
87 if (count_ == 0) t_.setCurrentTime();
88 }
◆ clear()
void cybozu::CpuClock::clear |
( |
| ) |
|
|
inline |
Definition at line 103 of file benchmark.hpp.
103{ t_.setTime(0, 0); clock_ = 0; count_ = 0; }
◆ end()
void cybozu::CpuClock::end |
( |
| ) |
|
|
inline |
Definition at line 92 of file benchmark.hpp.
93 {
94 cybozu::Time cur(true);
95 int diffSec = (int)(cur.getTime() - t_.getTime());
96 int diffMsec = cur.getMsec() - t_.getMsec();
97 const int diff = diffSec * 1000 + diffMsec;
99 count_++;
100 }
void diff(const std::string &a, const std::string &b)
◆ getClock()
uint64_t cybozu::CpuClock::getClock |
( |
| ) |
const |
|
inline |
◆ getCount()
int cybozu::CpuClock::getCount |
( |
| ) |
const |
|
inline |
◆ put()
void cybozu::CpuClock::put |
( |
const char * | msg = 0, |
|
|
int | N = 1 ) const |
|
inline |
Definition at line 104 of file benchmark.hpp.
105 {
107 if (msg && *msg)
printf(
"%s ", msg);
108 if (t > 1) {
110 } else if (t > 1e-3) {
111 printf(
"%6.2fusec", t * 1e3);
112 } else {
113 printf(
"%6.2fnsec", t * 1e6);
114 }
115 if (msg && *msg)
printf(
"\n");
116 }
uint64_t getClock() const
LOGGING_API void printf(Category category, const char *format,...)
◆ loopN1
const int cybozu::CpuClock::loopN1 = 1000000 |
|
static |
◆ loopN2
const int cybozu::CpuClock::loopN2 = 1000 |
|
static |
◆ maxClk
The documentation for this class was generated from the following file:
- libraries/fc/libraries/ff/depends/ate-pairing/include/cybozu/benchmark.hpp