CA1601: Do not use timers that prevent power state changes
Applies to: Visual Studio Visual Studio for Mac
Note
This article applies to Visual Studio 2017. If you're looking for the latest Visual Studio documentation, see Visual Studio documentation. We recommend upgrading to the latest version of Visual Studio. Download it here
Item | Value |
---|---|
RuleId | CA1601 |
Category | Microsoft.Mobility |
Breaking change | Breaking |
Cause
A timer has an interval set to occur more than one time per second.
Rule description
Do not poll more often than one time per second or use timers that occur more frequently than one time per second. Higher-frequency periodic activity will keep the CPU busy and interfere with power-saving idle timers that turn off the display and hard disks.
How to fix violations
Set timer intervals to occur less than one time per second.
When to suppress warnings
This rule should be suppressed only if firing the timer more than one time per second is required and mobility considerations can safely be ignored.