Browse Source

comments, better debug message

pull/2/head
Odilitime 5 years ago
parent
commit
697e654d77
  1. 7
      src/main.cpp

7
src/main.cpp

@ -14,17 +14,22 @@ const std::unique_ptr<Window> window = std::make_unique<Window>(); @@ -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;
}

Loading…
Cancel
Save