Skip to content
Snippets Groups Projects
Commit 5eac951e authored by Christoph Hasse's avatar Christoph Hasse :cartwheel_tone1:
Browse files

fix timing printout

parent 64f02ff3
No related branches found
No related tags found
1 merge request!2699FunctorFactory, replace CLING backend with native compiler
......@@ -151,9 +151,6 @@ struct FunctorFactory : public extends<Service, Functors::IFactory> {
auto start_time = std::chrono::high_resolution_clock::now();
FILE* pipe = popen( cmd.c_str(), "r" );
if ( pipe == nullptr ) { throw exception( "Couldn't start command." ); }
auto total_time =
std::chrono::duration_cast<std::chrono::seconds>( std::chrono::high_resolution_clock::now() - start_time );
info() << "Compilation of functor library took " << total_time.count() << " seconds" << endmsg;
// this is going to feel a bit complicated but we are very much in
// C-Land here when using `popen` so reading the output from the
......@@ -169,6 +166,9 @@ struct FunctorFactory : public extends<Service, Functors::IFactory> {
while ( fgets( buffer.data(), buffer_size, pipe ) != nullptr ) { cmd_out += buffer.data(); }
auto returnCode = pclose( pipe );
auto total_time =
std::chrono::duration_cast<std::chrono::seconds>( std::chrono::high_resolution_clock::now() - start_time );
info() << "Compilation of functor library took " << total_time.count() << " seconds" << endmsg;
if ( returnCode != 0 ) { throw exception( "Non zero return code!\n" + cmd_out ); }
if ( msgLevel( MSG::DEBUG ) ) {
debug() << "Return code: " << returnCode << "\nProcess stdout and stderr:\n" << cmd_out << endmsg;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment