From 6b324b83d480fa49a62d1e1e7327eaa9dbccd912 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=BCnter=20Obiltschnig?= Date: Mon, 3 Feb 2025 09:34:13 +0100 Subject: [PATCH] enh(Util): add Timer::taskCount() --- Util/include/Poco/Util/Timer.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Util/include/Poco/Util/Timer.h b/Util/include/Poco/Util/Timer.h index b6bd14a85..3f31f894b 100644 --- a/Util/include/Poco/Util/Timer.h +++ b/Util/include/Poco/Util/Timer.h @@ -162,6 +162,9 @@ public: bool idle() const; /// Returns true if the task queue is empty, otherwise false. + std::size_t taskCount() const; + /// Returns the number of tasks currently scheduled in the timer. + template static TimerTask::Ptr func(const Fn& fn) /// Helper function template to use a functor or lambda @@ -200,6 +203,12 @@ inline bool Timer::idle() const } +inline std::size_t Timer::taskCount() const +{ + return _queue.size(); +} + + } } // namespace Poco::Util