The time scale for cooling of the gravitationally bound gaseous intracluster medium (ICM) is not determined by radiative processes alone. If the ICM is in quasi-hydrostatic equilibrium in the fixed gravitational field of the dark matter halo then energy losses incurred by the gravitational potential energy of the gas should also be taken into account. This “gravitational heating” has been known for a while using explicit solutions to the equations of motion. Here, we re-visit this effect by applying the virial theorem to gas in quasi-hydrostatic equilibrium in an external gravitational field, neglecting the gravity of the gas. For a standard NFW form of halo profiles and for a finite gas density, the response of the gas temperature to changes in the total energy is significantly delayed. The effective cooling time could be prolonged by more than an order of magnitude inside the scale radius (rs) of the halo. Gas lying at a distance twice the scale radius, has negative heat capacity so that the temperature increases as a result of energy losses. Although external heating (e.g. by AGN activity) is still required to explain the lack of cool ICM near the center, the analysis here may circumvent the need for heating in farther out regions where the effective cooling time could be prolonged to become larger than the cluster age and also explains the increase of temperature with radius in these regions.