Heat generation by electric current in mesoscopic devices