- XBT_DEBUG("[cpu_update_energy] period=[%.2f-%.2f]; current power peak=%.0E flop/s; consumption change: %.2f J -> %.2f J",
- start_time, finish_time, cpu->m_powerPeak, previous_energy, energy_this_step);
-}
-static void update_consumption_off(Cpu *cpu, CpuEnergy *cpu_energy) {
- double start_time = cpu_energy->last_updated;
- double finish_time = surf_get_clock();
+ double instantaneous_consumption;
+ if (cpu->getState() == SURF_RESOURCE_OFF)
+ instantaneous_consumption = cpu_energy->watts_off;
+ else
+ instantaneous_consumption = cpu_energy->getCurrentWattsValue(cpu_load);