Skip to content
Snippets Groups Projects
Commit b8184b93 authored by Giovanni La Mura's avatar Giovanni La Mura
Browse files

Add a logger to np_trapping and use it to write the execution time

parent b9f6783f
Branches
Tags
No related merge requests found
......@@ -2,9 +2,14 @@
*
* \brief Trapping problem handler.
*/
#include <chrono>
#include <cstdio>
#include <string>
#ifndef INCLUDE_LOGGING_H_
#include "../include/logging.h"
#endif
using namespace std;
extern void frfme(string data_file, string output_path);
......@@ -17,9 +22,13 @@ extern void lffft(string data_file, string output_path);
* \return result: `int`
*/
int main(int argc, char **argv) {
chrono::time_point<chrono::high_resolution_clock> t_start = chrono::high_resolution_clock::now();
chrono::duration<double> elapsed;
string frfme_data_file = "../../test_data/trapping/DFRFME";
string lffft_data_file = "../../test_data/trapping/DLFFFT";
string output_path = ".";
string message;
Logger logger(LOG_DEBG);
if (argc == 4) {
frfme_data_file = string(argv[1]);
lffft_data_file = string(argv[2]);
......@@ -27,5 +36,8 @@ int main(int argc, char **argv) {
}
frfme(frfme_data_file, output_path);
lffft(lffft_data_file, output_path);
elapsed = chrono::high_resolution_clock::now() - t_start;
message = "INFO: calculation lasted " + to_string(elapsed.count()) + "s.\n";
logger.log(message);
return 0;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment