feat: implement ostream operator for timer
This commit is contained in:
parent
64ae4c62a9
commit
42b8c8d7e7
3 changed files with 23 additions and 3 deletions
|
@ -17,7 +17,7 @@ vector<string> generate_word_list() {
|
|||
auto word_list = WordListGenerator().generate();
|
||||
generator_timer.stop();
|
||||
|
||||
cout << "word list generator took " << generator_timer.us() << " µs" << endl;
|
||||
cout << "word list generator took " << generator_timer << endl;
|
||||
cout << "word list is " << word_list.size() << " element(s) long" << endl;
|
||||
|
||||
return word_list;
|
||||
|
@ -34,7 +34,7 @@ void test_linear_finder(const vector<string> &word_list) {
|
|||
auto result = linear_finder.find_prefix("ABCD");
|
||||
find_timer.stop();
|
||||
|
||||
cout << "linear finder took " << find_timer.us() << " µs" << endl;
|
||||
cout << "linear finder took " << find_timer << endl;
|
||||
cout << "result list is " << result.size() << " element(s) long" << endl;
|
||||
}
|
||||
|
||||
|
@ -53,7 +53,7 @@ void test_parallel_finder(const vector<string> &word_list) {
|
|||
auto result = parallel_finder.find_prefix("ABCD");
|
||||
find_timer.stop();
|
||||
|
||||
cout << "parallel finder took " << find_timer.us() << " µs" << endl;
|
||||
cout << "parallel finder took " << find_timer << endl;
|
||||
cout << "result list is " << result.size() << " element(s) long" << endl;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue