U.S. companies will have to disclose their CEOs' pay in comparison with that of their workers, in a proposed rule.

Wall Street's top regulator, the Securities and Exchange Commission, agreed 3-to-2 at a meeting Wednesday to a draft rule that would force publicly traded companies to disclose a ratio that compares CEO pay with that of salaries of those who work for them.

The rule is a result of the Dodd-Frank Wall Street reforms of 2010. The rule has been slow to be adopted, partly because it lacked a deadline and big companies lobbied against it.

Companies have said that a pay ratio is difficult to create. Nearly two dozen groups and associations -- including those representing the oil, retail and financial services industries -- sent a letter to the SEC in 2012 complaining about "significant hurdles and burdens " of collecting such information. They also say it's not useful to investors.

Related: SEC considers pay rule

The SEC decided to make things a little easier by saying the companies don't have to collect all salaries, they just need to take a statistical sample of workers in the middle of the pay scale.

That method would "provide companies significant flexibility in complying with the disclosure requirement," said SEC Chairman Mary Jo White at the meeting.

Unions have been pushing for the rule, which would highlight inequality of pay at U.S. companies between rank-and-file workers and those at the top.

Chief executives of the nation's largest companies earned an average of $12.3 million in total pay last year -- 354 times more than a typical American worker, according to the AFL-CIO, which represents more than 50 trade unions.

Related: SEC fines 23 firms over short selling

The rule isn't likely to take effect until next year, or even later. Companies and others get at least 90 days, possibly more to comment on the rule and make suggestions. Later, the SEC will review the comments and make changes to the rule before making a final decision.