|
| std::string | name |
| |
| unsigned int | secs |
| |
| bool | started {false} |
| |
| unsigned int | count {0} |
| |
| struct timespec | t = {0, 0} |
| |
◆ BaseCounter()
| BaseCounter::BaseCounter |
( |
const std::string & |
name, |
|
|
unsigned int |
secs |
|
) |
| |
110{
112}
static unsigned int columnWidth
Definition measure-framerate-tests.cc:51
std::string name
Definition measure-framerate-tests.cc:45
unsigned int secs
Definition measure-framerate-tests.cc:46
◆ operator()()
| bool BaseCounter::operator() |
( |
| ) |
|
115{
116 if(!
started && 0 == clock_gettime(CLOCK_REALTIME, &
t))
117 {
119 return true;
120 }
121
123
124 struct timespec now = {0, 0};
125 if(0 == clock_gettime(CLOCK_REALTIME, &now))
126 {
127 if(now.tv_sec >
t.tv_sec +
secs)
128 {
129
130 double elapsed = now.tv_nsec -
t.tv_nsec * 1e-9;
131 elapsed += now.tv_sec -
t.tv_sec;
133
134 return false;
135 }
136 }
137
138 return true;
139}
bool started
Definition measure-framerate-tests.cc:47
struct timespec t
Definition measure-framerate-tests.cc:49
unsigned int count
Definition measure-framerate-tests.cc:48
Scroom::Logger logger
Definition measure-framerate-tests.cc:24
Referenced by InvalidatingCounter::operator()().
◆ columnWidth
| unsigned int BaseCounter::columnWidth = 0 |
|
staticprivate |
◆ count
| unsigned int BaseCounter::count {0} |
|
private |
◆ name
| std::string BaseCounter::name |
|
private |
◆ secs
| unsigned int BaseCounter::secs |
|
private |
◆ started
| bool BaseCounter::started {false} |
|
private |
| struct timespec BaseCounter::t = {0, 0} |
|
private |
The documentation for this class was generated from the following file: