summaryrefslogtreecommitdiff
path: root/timing.h
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2007-04-27 10:08:05 +0000
committerJohn Wiegley <johnw@newartisans.com>2008-04-13 03:38:31 -0400
commit4716975cb18795e4a953fc705cf0b7c74d6a1c95 (patch)
tree4e22788779337c306aa9b83282e7a67c52b6004c /timing.h
parent9039e728b2015b54dc87da52f450c27683303392 (diff)
downloadfork-ledger-4716975cb18795e4a953fc705cf0b7c74d6a1c95.tar.gz
fork-ledger-4716975cb18795e4a953fc705cf0b7c74d6a1c95.tar.bz2
fork-ledger-4716975cb18795e4a953fc705cf0b7c74d6a1c95.zip
More work done toward rearranging the utility code.
Diffstat (limited to 'timing.h')
-rw-r--r--timing.h61
1 files changed, 0 insertions, 61 deletions
diff --git a/timing.h b/timing.h
deleted file mode 100644
index 51a3e7c4..00000000
--- a/timing.h
+++ /dev/null
@@ -1,61 +0,0 @@
-#ifndef _TIMING_H
-#define _TIMING_H
-
-namespace ledger {
-
-class timing_t
-{
- public:
- std::clock_t begin;
- std::clock_t cumulative;
- string file;
- unsigned long line;
- string symbol;
- string category;
-
- timing_t(const string& _symbol, const string& _category)
- : begin(0), cumulative(0), symbol(_symbol), category(_category) {}
-
- timing_t(const string& _symbol)
- : begin(0), cumulative(0), symbol(_symbol) {}
-
- ~timing_t() {
- string cls = "timing.results.";
- cls += symbol;
-#if 0
- // jww (2007-04-19): This crashes things nowadays
- DEBUG_PRINT(cls.c_str(), file << ":" << line << ": "
- << category << " = "
- << (double(cumulative) / double(CLOCKS_PER_SEC)) << "s");
-#endif
- }
-
- void start(const string& _file, unsigned long _line) {
- file = _file;
- line = _line;
- begin = std::clock();
- }
- void start() {
- begin = std::clock();
- }
-
- void stop() {
- cumulative += std::clock() - begin;
- }
-};
-
-#if 0 && DEBUG_LEVEL >= 4
-#define TIMER_DEF(sym, cat) static timing_t sym(#sym, cat);
-#define TIMER_DEF_(sym) static timing_t sym(#sym, #sym);
-#define TIMER_START(sym) sym.start(__FILE__, __LINE__);
-#define TIMER_STOP(sym) sym.stop();
-#else
-#define TIMER_DEF(sym, cat)
-#define TIMER_DEF_(sym)
-#define TIMER_START(sym)
-#define TIMER_STOP(sym)
-#endif
-
-} // namespace ledger
-
-#endif // _TIMING_H