58 while ((current=
strstr (current,
"took"))) {
60 while (*current && (*current ==
'(')) {
63 while (*current && (*current <
'0' || *current >
'9')) {
66 while (*current && *current >=
'0' && *current <=
'9') {
121 timer_start (
"task1");
122 bench_print (
ostream,
"task1");
123 string out=
ostream.unbuffer ();
128 timer_cumul (
"task1");
130 bench_print (
ostream,
"task1");
137 SUBCASE (
"start multiple times") {
138 timer_start (
"task2");
140 timer_cumul (
"task2");
141 bench_print (
ostream,
"task1");
142 string out=
ostream.unbuffer ();
148 timer_start (
"task2");
150 timer_cumul (
"task2");
152 bench_print (
ostream,
"task2");
167 timer_reset (
"task");
169 string out=
ostream.unbuffer ();
174 SUBCASE (
"if task not empty") {
175 timer_start (
"task");
176 timer_cumul (
"task");
177 timer_start (
"task");
178 timer_cumul (
"task");
180 timer_reset (
"task");
182 string out=
ostream.unbuffer ();
194 string b=
"Task 'task' took 0 ms\n";
199 timer_reset (
"task1");
200 timer_start (
"task1");
201 timer_cumul (
"task1");
202 timer_start (
"task1");
203 timer_cumul (
"task1");
204 bench_print (
ostream,
"task1");
206 string ans=
"Task 'task1' took 0 ms (2 invocations)\n";
212 SUBCASE (
"print multiple task") {
213 timer_reset (
"task1");
214 timer_reset (
"task2");
216 timer_start (
"task1");
217 timer_cumul (
"task1");
218 timer_start (
"task2");
219 timer_cumul (
"task2");
223 string b =
"Task 'task1' took 0 ms\nTask 'task2' took 0 ms\n";
230 timer_reset (
"task");
231 timer_reset (
"task1");
232 timer_reset (
"task2");
array< string > tokenize(string s, string sep)
bool read_int(string s, int &i, int &result)
int N(array< T > a)
Get the length of the array.
The list class represents a linked list.
#define TEST_MEMORY_LEAK_INIT
void timer_reset(string task)
void bench_print(tm_ostream &ostream, string task, uint32_t threshold)
void timer_start(string task)
void timer_cumul(string task)
TEST_CASE("test for operator+= and advance()")
int get_timing_cumul(string out)
int get_timing_nr(string out)
string to_zero(tm_ostream &out)
bool test_same(tm_ostream &a, string b)