Skip to content

Commit

Permalink
enh(Util): add Timer::taskCount()
Browse files Browse the repository at this point in the history
  • Loading branch information
obiltschnig committed Feb 3, 2025
1 parent 5cab3be commit 6b324b8
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions Util/include/Poco/Util/Timer.h
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,9 @@ class Util_API Timer: protected Poco::Runnable
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
Expand Down Expand Up @@ -200,6 +203,12 @@ inline bool Timer::idle() const
}


inline std::size_t Timer::taskCount() const
{
return _queue.size();
}


} } // namespace Poco::Util


Expand Down

0 comments on commit 6b324b8

Please sign in to comment.