Patent ID: 7197654

Claim:
A method for managing power consumption of a computer system comprising: a processing unit, peripherals, a clock for the processing unit, a clock for most of the peripherals, a software system with a periodic timer interrupt, and access to at least one hardware timer, the method comprising steps of: determining a time period for which the software system is not expected to perform work; determining one of at least two low power states in which to put the processing unit in response to said time period; wherein the at least two low power states comprise an idle state wherein the clock for the processing unit is stopped and a sleep state wherein the clock for most of the peripherals is further stopped; wherein the step of determining one of at least two low power states in which to put the processing unit further comprises a step of: accounting for energy to be spent while entering and exiting said at least two low power states; reading a time interval remainder of the at least one hardware timer; configuring the at least one hardware timer to facilitate waking up the software system in time for the software system to perform expected work; transitioning the processing unit and the software system into said low power state; and transitioning the processing unit and the software system out of said low power state in response to a hardware interrupt.