ConfigUtility now supports recursion; is a Singleton

If you have "config.next" set, the config system will load that as another
config file. Higher config files have a higher precedence over subfiles
when conflicting keys are encountered.

* Added singleton.hpp, containing Singleton<T>
* ConfigUtility now inherits from Singleton
* Tweaked timer.*pp layouts
This commit is contained in:
Kayne Ruse
2014-08-03 23:14:56 +10:00
parent 10c89970cc
commit c830fa0537
5 changed files with 135 additions and 28 deletions
+18 -2
View File
@@ -21,9 +21,25 @@
*/
#include "timer.hpp"
Timer::Timer(): start(Timer::Clock::now()) {
//
}
Timer::Timer(std::string s): name(s), start(Timer::Clock::now()) {
//
}
void Timer::Start() {
start = Clock::now();
}
void Timer::Stop() {
timeSpan = Clock::now() - start;
}
std::ostream& operator<<(std::ostream& os, Timer& t) {
os << t.GetName() << ": ";
os << std::chrono::duration_cast<std::chrono::nanoseconds>(t.GetTime()).count();
os << "ns";
os << std::chrono::duration_cast<std::chrono::milliseconds>(t.GetTime()).count();
os << "ms";
return os;
}