diff --git a/src/cluster/cluster.cpp b/src/cluster/cluster.cpp index 6de933940eb5deb12e38167c3760d6e0556bed5c..609da98885a543d37421ace93725f0fbf748e35e 100644 --- a/src/cluster/cluster.cpp +++ b/src/cluster/cluster.cpp @@ -4,6 +4,7 @@ * * \brief Implementation of the calculation for a cluster of spheres. */ +#include <chrono> #include <cstdio> #include <exception> #include <fstream> @@ -61,6 +62,7 @@ int cluster_jxi488_cycle(int jxi488, ScattererConfiguration *sconf, GeometryConf * \param output_path: `string` Directory to write the output files in. */ void cluster(string config_file, string data_file, string output_path) { + chrono::time_point<chrono::high_resolution_clock> t_start = chrono::high_resolution_clock::now(); Logger *logger = new Logger(LOG_INFO); logger->log("INFO: making legacy configuration...", LOG_INFO); ScattererConfiguration *sconf = NULL; @@ -795,6 +797,10 @@ void cluster(string config_file, string data_file, string output_path) { } delete sconf; delete gconf; + chrono::time_point<chrono::high_resolution_clock> t_end = chrono::high_resolution_clock::now(); + const chrono::duration<double> elapsed = t_end - t_start; + string message = "Calculation lasted " + to_string(elapsed.count()) + ".\n"; + logger->log(message); logger->log("Finished: output written to " + output_path + "/c_OCLU\n"); delete logger; }