From db6a999bc99b7749ceaf353c7042d3bb05c0e38a Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sun, 8 Oct 2023 04:48:52 +0200 Subject: a --- test/dijkstra.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'test') diff --git a/test/dijkstra.cpp b/test/dijkstra.cpp index d34e28bf..c19a7fcb 100644 --- a/test/dijkstra.cpp +++ b/test/dijkstra.cpp @@ -1,5 +1,6 @@ #include "app.hpp" #include "path-search.hpp" +#include namespace floormat { @@ -8,8 +9,18 @@ void test_app::test_dijkstra() auto w = world(); auto a = astar(); - a.Dijkstra(w, {}, 0, {{0, 0, 0}, {}}, {{1, 1, 0}, {}}, - 1*TILE_MAX_DIM*iTILE_SIZE2.x()); + using namespace std::chrono; + using clock = high_resolution_clock; + + const auto t0 = clock::now(); + + for (int i = 0; i < 10; i++) + { + a.Dijkstra(w, {}, 0, {{0, 0, 0}, {}}, {{1, 1, 0}, {}}, + 1*TILE_MAX_DIM*iTILE_SIZE2.x()); + } + const auto tm = clock::now() - t0; + Debug{} << "test took" << std::chrono::duration_cast(tm).count() << "ms."; } } // namespace floormat -- cgit v1.2.3