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; }
115 #endif // INCLUDED_VCL_TASK_STOPWATCH_HXX
bool continueIter()
Returns true, if another iteration will probably pass in the time slot.
TaskStopwatch(bool bConciderLastIterTime=true)
Per default the watch considers the last iter time when asking for an other iteration, so considers Scheduler::acceptableTaskTime as a maximum value.
void reset()
Reset the stopwatch.
VclInputFlags m_eInputStop
VclInputFlags inputStop() const
sal_uInt64 m_nIterStartTicks
bool m_bConsiderLastIterTime
static unsigned int m_nTimeSlice
static bool AnyInput(VclInputFlags nType=VCL_INPUT_ANY)
Determine if there are any pending input events.
static void setTimeSlice(unsigned int nTimeSlice)
static unsigned int timeSlice()
Sets the time considered the acceptable maximum for a task to run.
Helper class primary used to track time of long running iterating tasks.
void setInputStop(VclInputFlags eInputStop=eDefaultInputStop)
Sets the input events, which should also "exceed" the stopwatch.