Skip to content

Commit bee03a6

Browse files
committed
update
1 parent cc39b95 commit bee03a6

2 files changed

Lines changed: 9 additions & 0 deletions

File tree

src/splib/include/sp.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@
2828
#include <algorithm>
2929
#include <iterator>
3030

31+
#include <chrono>
32+
3133
#ifdef USE_RCPP_ARMADILLO
3234
#include <RcppArmadillo.h>
3335
#else

src/splib/src/dijkstra.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ sp::dijkstra::compute_path(const int source_ind, const int dest_ind, const graph
3636
vertex_queue.insert(std::make_pair(0.0, source_ind));
3737

3838
bool found_dest = false;
39+
40+
std::chrono::time_point<std::chrono::system_clock> start = std::chrono::system_clock::now();
3941

4042
while (!found_dest && !vertex_queue.empty())
4143
{
@@ -74,6 +76,11 @@ sp::dijkstra::compute_path(const int source_ind, const int dest_ind, const graph
7476

7577
unvisited_set[u] = false;
7678
}
79+
80+
std::chrono::time_point<std::chrono::system_clock> end = std::chrono::system_clock::now();
81+
std::chrono::duration<double> elapsed_seconds = end-start;
82+
83+
std::cout << "elapsed time: " << elapsed_seconds.count() << "s\n";
7784
}
7885

7986
void

0 commit comments

Comments
 (0)