Context: Added ::debugTiming to wrap Timer formatting

This commit is contained in:
Paul Beckingham 2016-11-13 13:02:44 -05:00
parent 14e3224c5b
commit 302b5a5589
2 changed files with 16 additions and 0 deletions

View file

@ -29,6 +29,7 @@
#include <iostream>
#include <fstream>
#include <sstream>
#include <iomanip>
#include <algorithm>
#include <assert.h>
#include <stdlib.h>
@ -801,6 +802,20 @@ void Context::decomposeSortField (
}
}
////////////////////////////////////////////////////////////////////////////////
void Context::debugTiming (const std::string& details, const Timer& timer)
{
std::stringstream out;
out << "Timer "
<< details
<< ' '
<< std::setprecision (6)
<< std::fixed
<< timer.total_us () / 1.0e6
<< " sec";
debug (out.str ());
}
////////////////////////////////////////////////////////////////////////////////
// This capability is to answer the question of 'what did I just do to generate
// this output?'.

View file

@ -66,6 +66,7 @@ public:
void error (const std::string&); // Error message sink - non-maskable
void decomposeSortField (const std::string&, std::string&, bool&, bool&);
void debugTiming (const std::string&, const Timer&);
private:
void staticInitialization ();