From 157d4dedf9eec3f7e62ac713280a62a9653df97c Mon Sep 17 00:00:00 2001 From: Philip Trettner <Philip.Trettner@rwth-aachen.de> Date: Tue, 18 Mar 2014 15:23:40 +0100 Subject: [PATCH] Only warn once on windows for unsupported timer usage --- include/ACGL/Utils/PerformanceTimer.hh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/include/ACGL/Utils/PerformanceTimer.hh b/include/ACGL/Utils/PerformanceTimer.hh index ec520089..4c714bac 100644 --- a/include/ACGL/Utils/PerformanceTimer.hh +++ b/include/ACGL/Utils/PerformanceTimer.hh @@ -139,7 +139,8 @@ class CSystemTimer : public CProcessTimer { public: CSystemTimer() : CProcessTimer() { - ACGL::Utils::error() << "No system timer present on this OS - fallback to process time" << std::endl; + static bool warned = false; + if ( !warned++ ) ACGL::Utils::error() << "No system timer present on this OS - fallback to process time" << std::endl; } }; @@ -147,8 +148,9 @@ public: class CThreadTimer : public CProcessTimer { public: - CThreadTimer() : CProcessTimer() { - ACGL::Utils::error() << "No thread timer present on this OS - fallback to process time" << std::endl; + CThreadTimer() : CProcessTimer() { + static bool warned = false; + if ( !warned++ ) ACGL::Utils::error() << "No thread timer present on this OS - fallback to process time" << std::endl; } }; -- GitLab