Your gym treadmill began as a Victorian prison punishment.

In 1818, English engineer William Cubitt watched prisoners at Bury St Edmunds gaol sitting idle and decided that was unacceptable. His solution: a large paddle-wheel fixed to a wall, powered entirely by men stepping on its rungs. He called it the treadwheel, and within a decade, over 50 British prisons had one.
Convicts could spend six or more hours a day on the wheel — the equivalent of climbing thousands of feet — with short breaks timed by a bell. Some wheels were connected to millstones or water pumps, producing actual grain or drainage. But many were connected to nothing at all. The labour was the punishment. Pure, grinding, purposeless exhaustion by design.
The Victorians loved it. Reformers like Jeremy Bentham had argued that prison should deter through suffering, and the treadwheel delivered. Hard labour sentences explicitly meant treadwheel time. Oscar Wilde did stints on one at Reading Gaol in the 1890s, and later wrote that the experience nearly broke him.
Britain's Prisons Act of 1898 phased out the treadwheel, deeming it too brutal even by the standards of the era. Half a century later, an American fitness researcher named William Staub commercialised the motorised home treadmill in 1969, and the machine completed its full reinvention — from instrument of misery to aspirational lifestyle equipment.