mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-28 13:37:20 +02:00
Context: Added ::debugTiming to wrap Timer formatting
This commit is contained in:
parent
14e3224c5b
commit
302b5a5589
2 changed files with 16 additions and 0 deletions
|
@ -29,6 +29,7 @@
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
|
#include <iomanip>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <stdlib.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 capability is to answer the question of 'what did I just do to generate
|
||||||
// this output?'.
|
// this output?'.
|
||||||
|
|
|
@ -66,6 +66,7 @@ public:
|
||||||
void error (const std::string&); // Error message sink - non-maskable
|
void error (const std::string&); // Error message sink - non-maskable
|
||||||
|
|
||||||
void decomposeSortField (const std::string&, std::string&, bool&, bool&);
|
void decomposeSortField (const std::string&, std::string&, bool&, bool&);
|
||||||
|
void debugTiming (const std::string&, const Timer&);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void staticInitialization ();
|
void staticInitialization ();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue