This commit is contained in:
fanlumaster committed 2025-03-26 16:36:21 +08:00
1 parent f9f277c784
commit efa57fe37f
20 files changed
+605 -582

No files matched your search

+19
View File
@@ -0,0 +1,19 @@
#include "webview_utils.h"
void MeasureDomUpdateTime(ComPtr<ICoreWebView2> webview)
{
std::wstring script =
LR"(document.body.innerHTML = '<div>1. 原来</div> <div>2. 如此</div> <div>3. 竟然</div> <div>4. 这样</div> <div>5. 可恶</div> <div>6. 棋盘</div> <div>7. 磨合</div> <div>8. 樱花</div> </body>';)";
auto start = std::chrono::high_resolution_clock::now();
webview->ExecuteScript(script.c_str(), nullptr);
auto end = std::chrono::high_resolution_clock::now();
auto duration =
std::chrono::duration_cast<std::chrono::microseconds>(end - start);
std::wstring message =
L"DOM update time: " + std::to_wstring(duration.count()) + L" μs";
// LogMessageW(message.c_str());
}