From 2bc4c99a34c3e0582fe6a77bb7bcd3e824e31ac7 Mon Sep 17 00:00:00 2001 From: status102 <102887808+status102@users.noreply.github.com> Date: Sat, 7 Jun 2025 18:31:44 +0800 Subject: [PATCH] chore: test code --- src/MaaCore/Task/Interface/DebugTask.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/MaaCore/Task/Interface/DebugTask.cpp b/src/MaaCore/Task/Interface/DebugTask.cpp index 25fe0bc8b7..0b5e90ba9d 100644 --- a/src/MaaCore/Task/Interface/DebugTask.cpp +++ b/src/MaaCore/Task/Interface/DebugTask.cpp @@ -23,6 +23,19 @@ asst::DebugTask::DebugTask(const AsstCallback& callback, Assistant* inst) : bool asst::DebugTask::run() { + auto image = imread(utils::path("C:/users/status102/desktop/fight-.png")); + auto start_time = std::chrono::steady_clock::now(); + for (int i = 0; i < 100; i++) { + BattlefieldMatcher match(image); + match.set_object_of_interest({ .deployment = true }); + auto result = match.analyze(); + if (!result) { + Log.error("BattlefieldMatcher analyze failed"); + return false; + } + } + auto cost = std::chrono::duration_cast(std::chrono::steady_clock::now() - start_time); + Log.info(__FUNCTION__, "cost:", cost.count(), "ms"); auto cd1 = imread(utils::path("C:\\Users\\status102\\desktop/deploy_cost0.png")); auto cd2 = imread(utils::path("C:\\Users\\status102\\desktop/deploy_cost1.png")); BattlefieldMatcher match(cd2);