diff --git a/src/tests/system-tests/position_test.cc b/src/tests/system-tests/position_test.cc index d57e765b4..e35846656 100644 --- a/src/tests/system-tests/position_test.cc +++ b/src/tests/system-tests/position_test.cc @@ -101,6 +101,9 @@ private: std::shared_ptr config; std::shared_ptr config_f; std::string generated_kml_file; + + std::chrono::time_point start; + std::chrono::time_point end; }; @@ -353,6 +356,7 @@ int PositionSystemTest::run_receiver() control_thread = std::make_shared(config_f); } + start = std::chrono::system_clock::now(); // start receiver try { @@ -366,7 +370,7 @@ int PositionSystemTest::run_receiver() { std::cout << "STD exception: " << ex.what(); } - + end = std::chrono::system_clock::now(); // Get the name of the KML file generated by the receiver std::this_thread::sleep_for(std::chrono::milliseconds(2000)); FILE* fp; @@ -561,6 +565,8 @@ void PositionSystemTest::check_results() double static_2D_error_m = sqrt(pow(arma::mean(error_east_m), 2.0) + pow(arma::mean(error_north_m), 2.0)); double static_3D_error_m = sqrt(pow(arma::mean(error_east_m), 2.0) + pow(arma::mean(error_north_m), 2.0) + pow(arma::mean(error_up_m), 2.0)); + std::chrono::duration elapsed_seconds = end - start; + std::stringstream stm; std::ofstream position_test_file; if (!FLAGS_config_file_ptest.empty()) @@ -588,6 +594,9 @@ void PositionSystemTest::check_results() stm << "90% SAS = " << 0.833 * (sigma_E_2_precision + sigma_N_2_precision + sigma_U_2_precision) << " [m]" << std::endl; stm << "MRSE = " << sqrt(sigma_E_2_precision + sigma_N_2_precision + sigma_U_2_precision) << " [m]" << std::endl; stm << "SEP = " << 0.51 * (sigma_E_2_precision + sigma_N_2_precision + sigma_U_2_precision) << " [m]" << std::endl; + stm << std::endl; + + stm << "Receiver runtime: " << elapsed_seconds.count() << " [seconds]" << std::endl; std::cout << stm.rdbuf(); std::string output_filename = "position_test_output_" + PositionSystemTest::generated_kml_file.erase(PositionSystemTest::generated_kml_file.length() - 3, 3) + "txt";