From bac303273f92f4950a906fb518d9f5350ec3f9f1 Mon Sep 17 00:00:00 2001 From: Nik Bougalis Date: Fri, 26 Feb 2016 15:09:15 -0800 Subject: [PATCH] Report slow stop times only in release builds --- beast/threads/impl/Stoppable.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/beast/threads/impl/Stoppable.cpp b/beast/threads/impl/Stoppable.cpp index dbbfdbdec8..05613f0406 100644 --- a/beast/threads/impl/Stoppable.cpp +++ b/beast/threads/impl/Stoppable.cpp @@ -114,8 +114,13 @@ void Stoppable::stopAsyncRecursive (Journal j) onStop (); auto const ms = duration_cast( high_resolution_clock::now() - start).count(); + +#ifdef NDEBUG if (ms >= 10) j.fatal << m_name << "::onStop took " << ms << "ms"; +#else + (void)ms; +#endif for (Children::const_iterator iter (m_children.cbegin ()); iter != m_children.cend(); ++iter)