Some local libraries (e.g. in Heidelberg) or ecological initiatives lend devices to measure electricity consumption at the power plug. In particular, this is useful to measure other appliances as well.
Specifically for computers, they probably have some means that tell you their own consumption, but they may not be accurate or complete and will most certainly omit any peripherals, e.g. external hard drives.
greybeard@feddit.online 1 day ago
I use a KillaWatt device. It is a simple device you plug into the outlet and then plug the device you want to measure into it. I've had mine for a long time so I have no idea what a new one would cost, but I'm guessing sub $30.