10#ifndef INCLUDED_VCL_TASK_STOPWATCH_HXX
11#define INCLUDED_VCL_TASK_STOPWATCH_HXX
34 static constexpr unsigned int nDefaultTimeSlice = 50;
46 if (nCurTicks < m_nStartTicks)
49 if (m_bConsiderLastIterTime)
53 if (m_nTimeSlice < 2 * nCurTicks - m_nIterStartTicks - m_nStartTicks)
57 else if (m_nTimeSlice < nCurTicks - m_nStartTicks)
60 m_nIterStartTicks = nCurTicks;
76 : m_nStartTicks(
tools::
Time::GetSystemTicks())
77 , m_nIterStartTicks(m_nStartTicks)
78 , m_bConsiderLastIterTime(bConciderLastIterTime)
79 , m_eInputStop(eDefaultInputStop)
94 m_nIterStartTicks = m_nStartTicks;
111 static unsigned int timeSlice() {
return m_nTimeSlice; }
112 static void setTimeSlice(
unsigned int nTimeSlice) { m_nTimeSlice = nTimeSlice; }
static bool AnyInput(VclInputFlags nType=VCL_INPUT_ANY)
Determine if there are any pending input events.
Helper class primary used to track time of long running iterating tasks.
VclInputFlags inputStop() const
bool continueIter()
Returns true, if another iteration will probably pass in the time slot.
void reset()
Reset the stopwatch.
bool m_bConsiderLastIterTime
static unsigned int m_nTimeSlice
VclInputFlags m_eInputStop
void setInputStop(VclInputFlags eInputStop=eDefaultInputStop)
Sets the input events, which should also "exceed" the stopwatch.
static unsigned int timeSlice()
Sets the time considered the acceptable maximum for a task to run.
sal_uInt64 m_nIterStartTicks
TaskStopwatch(bool bConciderLastIterTime=true)
Per default the watch considers the last iter time when asking for an other iteration,...
static void setTimeSlice(unsigned int nTimeSlice)