From 4046be06720932a57a0f49416b0144b2858824d0 Mon Sep 17 00:00:00 2001 From: Daniel Wilhelm Date: Fri, 18 Apr 2014 16:59:06 +0200 Subject: 2.0 --- library/statistics.cpp | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'library/statistics.cpp') diff --git a/library/statistics.cpp b/library/statistics.cpp index ec03c59e..f2506da8 100644 --- a/library/statistics.cpp +++ b/library/statistics.cpp @@ -5,6 +5,11 @@ #include "statusHandler.h" #include "../algorithm.h" #include +#include + + +RetrieveStatistics::RetrieveStatistics() : + timer(new wxStopWatch) {} RetrieveStatistics::~RetrieveStatistics() @@ -30,7 +35,7 @@ void RetrieveStatistics::writeEntry(const double value, const int objects) statEntry newEntry; newEntry.value = value; newEntry.objects = objects; - newEntry.time = timer.Time(); + newEntry.time = timer->Time(); data.push_back(newEntry); } @@ -102,8 +107,8 @@ Statistics::Statistics(const int totalObjectCount, windowSizeRemTime(windowSizeRemainingTime), windowSizeBPS(windowSizeBytesPerSecond), windowMax(std::max(windowSizeRemainingTime, windowSizeBytesPerSecond)), - remainingTimeLast(256*256*256*100) //something "big" -{} + remainingTimeLast(256*256*256*100), //something "big" + timer(new wxStopWatch) {} void Statistics::addMeasurement(const int objectsCurrent, const double dataCurrent) @@ -111,7 +116,7 @@ void Statistics::addMeasurement(const int objectsCurrent, const double dataCurre record newEntry; newEntry.objects = objectsCurrent; newEntry.data = dataCurrent; - newEntry.time = timer.Time(); + newEntry.time = timer->Time(); //insert new record measurements.push_back(newEntry); @@ -176,13 +181,13 @@ wxString Statistics::getBytesPerSecond() const void Statistics::pauseTimer() { - timer.Pause(); + timer->Pause(); } void Statistics::resumeTimer() { - timer.Resume(); + timer->Resume(); } /* -- cgit