I would like to know if there is a programmatic way of measuring the energy consumption of a sketch or at least if this is possible via external devices.
My aim is to compare the energy consumption of two devices, connected to usb, running slightly modified versions of the same sketch e.g., one using crypto and one without using crypto.