summaryrefslogtreecommitdiffhomepage
path: root/test/dijkstra.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2023-10-08 04:48:52 +0200
committerStanislaw Halik <sthalik@misaki.pl>2023-10-08 04:48:52 +0200
commitdb6a999bc99b7749ceaf353c7042d3bb05c0e38a (patch)
tree1eb3708fa38341431e4f03f88aac43dd3c11d35c /test/dijkstra.cpp
parentdb63c70f6397a7b50d49bc431a0edfb6e2de2b5a (diff)
a
Diffstat (limited to 'test/dijkstra.cpp')
-rw-r--r--test/dijkstra.cpp15
1 files changed, 13 insertions, 2 deletions
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 <chrono>
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<milliseconds>(tm).count() << "ms.";
}
} // namespace floormat