enh(Util): add Timer::taskCount()

This commit is contained in:
Günter Obiltschnig 2025-02-03 09:34:13 +01:00
parent 5cab3be5c4
commit 6b324b83d4

View File

@ -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 <typename Fn>
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