From 9092708e231811a27aefc5a10ec212f3e104f7b3 Mon Sep 17 00:00:00 2001 From: Ingo Date: Thu, 27 Feb 2014 16:29:15 +0100 Subject: [PATCH] Increased precision of StopWatch class, no Issue --- rtengine/StopWatch.h | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/rtengine/StopWatch.h b/rtengine/StopWatch.h index e43b90247..468f0817c 100644 --- a/rtengine/StopWatch.h +++ b/rtengine/StopWatch.h @@ -22,7 +22,7 @@ #ifndef STOPWATCH_H #define STOPWATCH_H #include -#include +#include "mytime.h" class StopWatch { public: @@ -31,14 +31,13 @@ public: ~StopWatch() { if(!stopped) stop(); } void start() { - gettimeofday(&startStruct,NULL); + startTime.set(); }; void stop() { - gettimeofday(&stopStruct,NULL); - long elapsedTime = (stopStruct.tv_sec - startStruct.tv_sec) * 1000.0; // sec to ms - elapsedTime += (stopStruct.tv_usec - startStruct.tv_usec)/1000; - std::cout << message << " took " << elapsedTime << "ms" <