If anything keeps President Barack Obama awake at night, it is surely the plight of Gordon Brown, the dour British prime minister sent packing by an ungrateful electorate. Brooding in his Scottish redoubts, the hurt and rejected Brown, driven by the white heat of self-justification, sat down to write a memoir in which he pondered what went wrong.

When the financial crisis of 2008 hit, hadn’t he done everything he could to prevent Britain from slipping over the precipice into economic collapse? Brown was a brilliant economist who had lifted Britain to new levels of prosperity. He took his ingenious rescue plan to the G-20, where he was greeted as a hero. Obama and the other world leaders followed his example — and halted the Great Recession in its tracks.

Had it not been for Brown’s steady hand on the tiller in the midst of the greatest economic storm since 1929, the world would have tipped into penury and despair.

But as Brown found when it came time to make his case, it is impossibly difficult to prove a negative. His mastery of economics may have saved the world — but since disaster was averted, there was nothing much to show for his perspicacity except a sluggish recovery, a huge pile of debt and the absence of mass unemployment.

In the history of the world’s disasters, everyone recalls Edward Smith, the captain of the Titanic. No one remembers the captain who dodged an iceberg. Sometimes, thankless citizens don’t deserve their brilliant leaders. As U.S. voters like to put it, “What have you done for me lately?”

Now it is Obama’s turn to learn that ugly truth. He cannot, like Brown, claim authorship of a plan to avert the Great Recession. He inherited a scheme concocted by the Treasury team of predecessor President George W. Bush. He left some of Bush’s economic team, like Federal Reserve Chairman Ben Bernanke, in place to minimize disruption. Timothy Geithner, who helped plan the rescue when he was at the New York Fed, was taken on by Obama and remains there still.

The Bush remedy was wildly expensive and entailed taking on massive new levels of debt. Obama took it on trust that Bush’s people had their sums right because time was of the essence. Every day spent hesitating brought them closer to the edge of that cliff.

Obama acted and the policy worked. There was no Great Recession. Or, at least, the profound recession that we are now experiencing, longer and deeper than any in 80 years, would have been a Great Depression II had Obama not acted.

But the president cannot expect to be given credit for doing the right thing. One great quality of the American people is that they don’t spend time looking in the rearview mirror. The past is past. A disaster averted is a disaster forgotten.

Thereby hangs Obama’s problem come November. He saved us from despair — and we don’t care.

Instead, his opponents concentrate on the size of the debt burden. Never mind that it was a Republican president who presided over the prelude to the mess and it was a Republican president who reached for John Maynard Keynes instead of Friedrich Hayek to save America from a repeat of the Great Depression. There are no votes in blaming the other guy.

As Obama joked at the White House Correspondents’ Dinner, “In 2009, I took office in the face of some enormous challenges. Now, some have said I blame too many problems on my predecessor. But let’s not forget, that’s a practice that was initiated by George W. Bush.”

It was a laugh line because it was so true. But don’t expect White House correspondents to report that truth because avoiding the Great Recession is old hat. What was done was done.

Instead, between now and November, we can expect to hear a lot of nonsense about whether Obama’s (not George W.’s) $787 billion stimulus worked. The answer, in brief, is it did. Disaster was averted.

Could it have been implemented better? Sure. It could have been bigger. Even Hayek, traditionally cited when stimuluses are assessed, thought a Keynesian stimulus would put people back to work. Though he argued that, as soon as the stimulus money and the cheap credit were withdrawn, we would be back to square one.

Obama’s opponents in Congress haven’t let the president prolong the stimulus — as his jobs bill would have done — because it would add to the nation’s debt. By denying the president the means to stimulate the economy, they have prolonged the recession and kept people out of work. Which makes it more likely Mitt Romney will become president.

Which is just what Obama’s opponents have in mind.

Nicholas Wapshott is the author of “Keynes Hayek: The Clash That Defined Modern Economics.” Read extracts here.