Horsepower and torque measure different things. Horsepower is a measurement of the power of the rate at which work is done. Torque measures the rotating force around an axis. However, horsepower and torque are related by an equation: horsepower equals torque multiplied by angular speed.
For a rotating engine with a lever arm, the torque is equal to length of the lever arm multiplied by the force pushing against the arm. This is then multiplied by the sine of the angle between the force vector and the arm. As angular speed is generally measured in radians per second, a more conventional expression of the speed of a rotating engine is in revolutions per second. Torque multiplied by revolutions per minute, divided by the constant 5252, yields an engine's power in units of horsepower.