Yes. It took decades of hard fights, including many that ended up in violent confrontations, to get the working day down from 12+ hours to about 8.
May 1 as an international day of labour demonstration was partly inspired by the immense effort of the US unions at fighting for the 8 hour day, and partly as a commemoration of the Haymarket massacre in Chicago that were part of that struggle:
Even today, there's plenty of people who want to reverse those gains. E.g. in the UK, our sitting PM is trying hard to get additional exemptions for the UK from the EU Working Time Directive because it limits how much extra time employers can demand and/or ask for.
That makes assumptions efficiency as it relates to number of hours worked that I'm not sure you can make.
How many of those 40 hours are really spent working?
40 hour work weeks are the result of labor regulations, and the binding of health insurance to full-time employment, not a free market equilibrium.