45 std::chrono::steady_clock::time_point &begin_elapsed,
48 start_t = std::time(NULL);
49 begin_elapsed = std::chrono::steady_clock::now();
55 const std::time_t start_t,
56 std::chrono::steady_clock::time_point& begin_elapsed,
58 std::ostringstream &log) {
59 clock_t end = clock();
61 static_cast<double>(end - begin)
62 /
static_cast<double>(CLOCKS_PER_SEC);
64 std::time_t end_t = std::time(NULL);
65 std::chrono::steady_clock::time_point end_elapsed =
66 std::chrono::steady_clock::now();
68 typedef std::chrono::duration<int, std::milli> millisecs_t;
69 millisecs_t duration = std::chrono::duration_cast<millisecs_t>(
70 end_elapsed - begin_elapsed);
72 log <<
"Execution started at: " << std::ctime(&start_t);
73 log <<
"Execution ended at: " << std::ctime(&end_t);
74 log <<
"Elapsed time: "
75 <<
static_cast<double>(duration.count())/
static_cast<double>(1000)
77 log <<
"User CPU time: -> " << elapsed_secs <<
" seconds\n";
84 int64_t *start_vertex,
size_t s_len,
92 std::ostringstream log;
93 std::ostringstream err;
94 std::ostringstream notice;
107 std::deque<Path> paths;
108 std::vector<int64_t> start_vertices(start_vertex, start_vertex + s_len);
115 std::chrono::steady_clock::time_point begin_elapsed;
120 start_timing(start_t, begin_elapsed, begin);
121 log <<
"*********Creating graph at time: " << std::ctime(&start_t)
126 end_timing(start_t, begin_elapsed, begin, log);
130 start_timing(start_t, begin_elapsed, begin);
131 log <<
"********Inserting edges at time: " << std::ctime(&start_t)
136 end_timing(start_t, begin_elapsed, begin, log);
140 start_timing(start_t, begin_elapsed, begin);
141 log <<
"*******Calling the C++ call to pgr_drivingDistance: "
142 << std::ctime(&start_t) <<
"\n";
145 digraph, start_vertices, distance, equiCostFlag, log);
147 end_timing(start_t, begin_elapsed, begin, log);
151 start_timing(start_t, begin_elapsed, begin);
152 log <<
"******Creating graph at time: " << std::ctime(&start_t)
157 end_timing(start_t, begin_elapsed, begin, log);
161 start_timing(start_t, begin_elapsed, begin);
162 log <<
"*******Inserting edges at time: " << std::ctime(&start_t)
167 end_timing(start_t, begin_elapsed, begin, log);
171 start_timing(start_t, begin_elapsed, begin);
172 log <<
"*******Calling the C++ call to pgr_drivingDistance: "
173 << std::ctime(&start_t) <<
"\n";
176 undigraph, start_vertices, distance, equiCostFlag, log);
178 end_timing(start_t, begin_elapsed, begin, log);
186 log <<
"\nNo return values were found";
187 *notice_msg =
pgr_msg(log.str().c_str());
190 *return_tuples =
pgr_alloc(count, (*return_tuples));
192 *return_count = trueCount;
195 *log_msg = log.str().empty()?
198 *notice_msg = notice.str().empty()?
202 (*return_tuples) =
pgr_free(*return_tuples);
204 err << except.
what();
205 *err_msg =
pgr_msg(err.str().c_str());
206 *log_msg =
pgr_msg(log.str().c_str());
207 }
catch (std::exception &except) {
208 (*return_tuples) =
pgr_free(*return_tuples);
210 err << except.what();
211 *err_msg =
pgr_msg(err.str().c_str());
212 *log_msg =
pgr_msg(log.str().c_str());
214 (*return_tuples) =
pgr_free(*return_tuples);
216 err <<
"Caught unknown exception!";
217 *err_msg =
pgr_msg(err.str().c_str());
218 *log_msg =
pgr_msg(log.str().c_str());