Skip to content
Snippets Groups Projects
Commit 697e654d authored by Odilitime's avatar Odilitime
Browse files

comments, better debug message

parent b67a0990
No related branches found
No related tags found
No related merge requests found
......@@ -14,17 +14,22 @@ const std::unique_ptr<Window> window = std::make_unique<Window>();
bool setWindowContent(URL const& url) {
logDebug() << "main::setWindowContent - " << url << std::endl;
// download URL
WebResource res = getWebResource(url);
if (res.resourceType == ResourceType::INVALID) {
logError() << "Invalid resource type: " << res.raw << std::endl;
return false;
}
// parse HTML
HTMLParser parser;
const std::clock_t begin = clock();
std::shared_ptr<Node> rootNode = parser.parse(res.raw);
const std::clock_t end = clock();
logDebug() << "Parsed document in: " << std::fixed << ((static_cast<double>(end - begin)) / CLOCKS_PER_SEC) << std::scientific << " seconds" << std::endl;
logDebug() << "main::setWindowContent - Parsed document in: " << std::fixed << ((static_cast<double>(end - begin)) / CLOCKS_PER_SEC) << std::scientific << " seconds" << std::endl;
// send NodeTree to window
window->setDOM(rootNode);
return true;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment