This article explains when an iMac computer's degauss circuitry is activated.
The degauss circuitry in an iMac computer activates at these times:
The degauss circuitry does not activate when the computer wakes from sleep.
Degaussing works best when the computer has been turned off for a period of time, and its components have been allowed to cool. To remove any residual magnetic fields that may build up over time, you should occasionally shut down the computer, let it sit for a time, and then start it up.
For more information, see document 30485: "Monitors: Influence of External Magnetic Fields".