The treadmill was originally invented to punish lazy prisoners, not for fitness.
In 1818, the British invented the prison treadmill, the prisoner needs to force the spokes to drive the gears to play, pumping or grinding the grain.
Later, people invented the treadmill in the modern sense based on this prototype.