From 47a5c6ee3ebd013818203f2f48a8c5635074add8 Mon Sep 17 00:00:00 2001 From: "guo.2154" Date: Sat, 27 Jan 2024 23:32:14 -0500 Subject: [PATCH] measure time for building kdlite --- include/ftk/mesh/mpas_mesh.hh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/include/ftk/mesh/mpas_mesh.hh b/include/ftk/mesh/mpas_mesh.hh index 2d3a5bfb..45265542 100644 --- a/include/ftk/mesh/mpas_mesh.hh +++ b/include/ftk/mesh/mpas_mesh.hh @@ -7,6 +7,7 @@ #include #include #include +#include namespace ftk { @@ -129,9 +130,18 @@ void mpas_mesh::initialize() // kd_cells.reset(new kd_t); // kd_cells->set_inputs(this->xyzCells); // kd_cells->build(); + + fprintf(stderr, "building kdlite..\n"); + typedef std::chrono::high_resolution_clock clock_type; + + auto t0 = clock_type::now(); kdlite_heap.resize( n_cells()*3, -1 ); kdlite_build<3>((int)n_cells(), xyzCells.data(), kdlite_heap.data()); + + auto t1 = clock_type::now(); + fprintf(stderr, "time_kdlite=%f\n", + std::chrono::duration_cast(t1-t0).count() * 1e-9); } template