The Thermodynamic Efficiency in Static and Dynamic Black Holes