A significant fraction of the power lost from a confined plasma can be carried by energetic electrons. When such electrons are incident on a probe or limiting surface, they produce thick-target x rays. It is shown that a properly filtered measurement of this x-ray flux is proportional to the electron-power loss, with little dependence on the electron loss mechanism and velocity-space distribution. The diagnostic was successfully implemented to study the radial loss of hot electrons in the Tandem Mirror Experiment-Upgrade. The method provides a very fast measurement of electron loss processes, and could therefore be useful in other areas of plasma research such as magnetic confinement in tokamaks, and inertial-confinement fusion.