pub struct TimerType(/* private fields */);
Expand description
The timer type indicates how accurate a timer can be.
C++ enum: Qt::TimerType
.
The timer type indicates how accurate a timer can be.
On UNIX (including Linux, macOS, and iOS), Qt will keep millisecond accuracy for Qt::PreciseTimer. For Qt::CoarseTimer, the interval will be adjusted up to 5% to align the timer with other timers that are expected to fire at or around the same time. The objective is to make most timers wake up at the same time, thereby reducing CPU wakeups and power consumption.
On Windows, Qt will use Windows's Multimedia timer facility (if available) for Qt::PreciseTimer and normal Windows timers for Qt::CoarseTimer and Qt::VeryCoarseTimer.
On all platforms, the interval for Qt::VeryCoarseTimer is rounded to the nearest full second (e.g. an interval of 23500ms will be rounded to 24000ms, and 20300ms to 20000ms).
Implementations§
source§impl TimerType
impl TimerType
sourcepub const PreciseTimer: TimerType = _
pub const PreciseTimer: TimerType = _
Precise timers try to keep millisecond accuracy (C++ enum variant: PreciseTimer = 0
)
sourcepub const CoarseTimer: TimerType = _
pub const CoarseTimer: TimerType = _
Coarse timers try to keep accuracy within 5% of the desired interval (C++ enum variant: CoarseTimer = 1
)
sourcepub const VeryCoarseTimer: TimerType = _
pub const VeryCoarseTimer: TimerType = _
Very coarse timers only keep full second accuracy (C++ enum variant: VeryCoarseTimer = 2
)