Print time it took to parse scene file
This commit is contained in:
parent
36a7954df4
commit
5bcefd128c
1 changed files with 14 additions and 0 deletions
|
@ -8,6 +8,8 @@
|
||||||
|
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
|
|
||||||
|
#include <chrono>
|
||||||
#include <stack>
|
#include <stack>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
|
@ -40,6 +42,12 @@ YAMLReader::read_file(const std::string& filename)
|
||||||
yaml_parser_initialize(&parser);
|
yaml_parser_initialize(&parser);
|
||||||
|
|
||||||
printf("Reading %s\n", filename.c_str());
|
printf("Reading %s\n", filename.c_str());
|
||||||
|
LOG_INFO << "Reading " << filename;
|
||||||
|
|
||||||
|
/* Time the parse */
|
||||||
|
std::chrono::time_point<std::chrono::system_clock> start, end;
|
||||||
|
start = std::chrono::system_clock::now();
|
||||||
|
|
||||||
yaml_parser_set_input_file(&parser, yaml_infile);
|
yaml_parser_set_input_file(&parser, yaml_infile);
|
||||||
|
|
||||||
yaml::ParserStack parsers;
|
yaml::ParserStack parsers;
|
||||||
|
@ -115,6 +123,12 @@ YAMLReader::read_file(const std::string& filename)
|
||||||
|
|
||||||
error:
|
error:
|
||||||
yaml_parser_delete(&parser);
|
yaml_parser_delete(&parser);
|
||||||
|
|
||||||
|
end = std::chrono::system_clock::now();
|
||||||
|
std::chrono::duration<Double> seconds = end - start;
|
||||||
|
LOG_INFO << "Scene file parsed in " << seconds.count() << " seconds.";
|
||||||
|
printf("Scene file parsed in %f seconds.\n", seconds.count());
|
||||||
|
|
||||||
return success;
|
return success;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue