diff options
author | Morgan Deters <mdeters@cs.nyu.edu> | 2013-12-10 23:17:13 -0500 |
---|---|---|
committer | Morgan Deters <mdeters@cs.nyu.edu> | 2013-12-10 23:26:50 -0500 |
commit | b337066773212390eedff81aaacffe3f226b6549 (patch) | |
tree | 1409670b6951ea3c7fe05a07b00628eef971f96c /src/util/statistics_registry.h | |
parent | 811202ddd6851e61c71aa4db92a2231986aa99ff (diff) |
Fix timer statistics to report correct time even on process abort.
Diffstat (limited to 'src/util/statistics_registry.h')
-rw-r--r-- | src/util/statistics_registry.h | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/src/util/statistics_registry.h b/src/util/statistics_registry.h index 8ffc60d17..eb5245e25 100644 --- a/src/util/statistics_registry.h +++ b/src/util/statistics_registry.h @@ -179,7 +179,7 @@ public: } /** Get the value of the statistic. */ - virtual const T& getData() const = 0; + virtual T getData() const = 0; /** Flush the value of the statistic to the given output stream. */ void flushInformation(std::ostream& out) const { @@ -270,7 +270,7 @@ public: } /** Get the value of the referenced data cell. */ - const T& getData() const { + T getData() const { return *d_data; } @@ -312,7 +312,7 @@ public: } /** Get the underlying data value. */ - const T& getData() const { + T getData() const { return d_data; } @@ -354,7 +354,7 @@ public: } /** Get the data of the underlying (wrapped) statistic. */ - const T& getData() const { + T getData() const { return d_stat.getData(); } @@ -808,11 +808,9 @@ public: */ void stop(); - SExpr getValue() const { - std::stringstream ss; - ss << std::fixed << std::setprecision(8) << d_data; - return SExpr(Rational::fromDecimal(ss.str())); - } + timespec getData() const; + + SExpr getValue() const; };/* class TimerStat */ |