-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added for loop syntax
- Loading branch information
Showing
8 changed files
with
337 additions
and
218 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#include <iostream> | ||
#include <type_traits> | ||
#include <chrono> | ||
#include "seephit.h" | ||
using namespace std; | ||
|
||
|
||
|
||
int main() | ||
{ | ||
constexpr auto parser = | ||
#include "test/large_template.spt" | ||
|
||
REPORT_ERRORS(parser); | ||
|
||
// Start timer and run it | ||
auto tmStart = chrono::high_resolution_clock::now(); | ||
|
||
int k; | ||
for(int i = 0; i < 1000; ++i) | ||
{ | ||
spt::tree spt_tree(parser); | ||
spt::template_dict dct = spt_tree.get_default_dict(); | ||
spt_tree.root.render(cout, dct); | ||
k = dct.size(); | ||
} | ||
|
||
auto tmElapsed = chrono::high_resolution_clock::now() - tmStart; | ||
long long nano = chrono::duration_cast<std::chrono::nanoseconds>(tmElapsed).count(); | ||
double ms = nano/1000000.0F; | ||
cerr << ms << " ms elapsed" << endl; | ||
cerr << k << " unique template keys" << endl; | ||
|
||
cerr << endl; | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.