For more on Obama, see this post from 2006 on the moderate political blog Obsidian Wings, considering all the legislation he had worked on up till that time. These next three links are also from Obsidian Wings; each one includes the number, title, and subject of all the legislation the two men have enacted or co-sponsored in the last two Congresses.
In the Illinois state Senate, [Obama] authored about a half-dozen "major laws" on issues ranging from ethics to education. The best example of his leadership style was bipartisan legislation to require the videotaping of police interrogations, which is now a national model. Obama brought together police, prosecutors and the ACLU on a win-win bill that simultaneously increased conviction rates and all but ended jailhouse beatings. In Washington he has his name on three important laws: the first major ethics reform since Watergate; a much-needed cleanup of conventional weapons in the former Soviet Union, and the "Google for Government" bill, an accountability tool that requires notice of all federal contracts to be posted online. Besides that, Obama hasn't been around long enough to get much done.
McCain . . . too, has authored fewer than a half-dozen major laws. Trying to fix immigration counts for something, but nothing passed. So while McCain deserves credit for the landmark 2002 McCain-Feingold campaign-finance reform bill, the only other major law . . . is the "McCain Amendment" prohibiting torture in the armed forces. But that has little meaning because of a bill this year, supported by McCain, that allows torture by the CIA. Under longstanding government practice, military intelligence officers can be temporarily designated as CIA officers ("sheep-dipped" is the bureaucratic lingo) when they want to go off the Army field manual. In other words, the government can still torture anyone, any time.
A list of the bills and amendments enacted by each Senator in the 109th & 110th Congresses
Totals: Obama: 1 bill enacted, 2 on the calendar, 33 amendments; McCain: 2 bills enacted, 1 on the calendar, 19 amendments.
A list of the bills and amendments that each Senator co-sponsored in the 110th Congress
Totals: Both cosponsored: 2 passed, 2 on calendar; Obama: 3 passed, 3 on calendar, 25 amendments; McCain: 0 passed, 6 on calendar, 7 amendments.
A list of the bills and amendments that each Senator co-sponsored in the 109th Congress
Totals: Both cosponsored: 1 passed, 2 amendments; Obama: 1 passed, 32 amendments; McCain: 2 passed, 10 amendments
Of course this isn't the whole story -- what laws they pass or sponsor is as important as how many they pass, and you need to read through the list to get those. I suppose it is no surprise to say I prefer the type of legislation Obama seems to be interested in ("S.AMDT.726 to H.R.3 To establish a program to award grants on a competitive basis to eligible recipients for the replacement or retrofit of certain existing school buses"; "S.AMDT.1290 to H.R.3057 To make funds available for the African Union Mission in Sudan"; "S.AMDT.1886 to H.R.2863 To make available emergency funds for pandemic flu preparedness."), but you can make your own judgements. And I hope you do.