The campaign trail can be a lonely place, so Mitt Romney frequently invites friends to accompany him. New Jersey Gov. Chris Christie is an occasional companion. So is Virginia Gov. Bob McDonnell. But more often, Romney brings a large clock.

Romney’s people made it themselves. It has two giant flat-screen televisions pushed side by side. It’s surrounded by a green foam sign. And it’s hooked to two computers feeding it a live count of America’s rising debt burden, which stands well above $15 trillion. The clock represents President Obama’s economic failures. It’s there so Romney can point to it and tell the crowd that if he’s elected, he’ll “do a better job slowing down that clock.” But if you’re a deficit-obsessed voter, the clock doesn’t answer the key question: How much has Obama added to the debt, anyway?

There are two answers: more than $4 trillion, or about $983 billion. The first answer is simple and wrong. The second answer is more complicated but a lot closer to being right.

When Obama took office, the national debt was about $10.5 trillion. Today, it’s about $15.2 trillion. Simple subtraction gets you the answer preferred by most of Obama’s opponents: $4.7 trillion.

But ask yourself: Which of Obama’s policies added $4.7 trillion to the debt? The stimulus? That was just a bit more than $800 billion. TARP? That passed under George W. Bush, and most of it has been repaid.

There is a way to tally the effects Obama has had on the deficit. Look at every piece of legislation he has signed into law. Every time Congress passes a bill, either the Congressional Budget Office or the Joint Committee on Taxation estimates the effect it will have on the budget over the next 10 years. And then they continue to estimate changes to those bills. If you know how to read their numbers, you can come up with an estimate that zeros in on the laws Obama has had a hand in.

The Center on Budget and Policy Priorities was kind enough to help me come up with a comprehensive estimate of Obama’s effect on the deficit. As it explained to me, it’s harder than it sounds.

Obama, for instance, is clearly responsible for the stimulus. The health-care law, too.

When Obama entered office, the Bush tax cuts were already in place and two wars were ongoing. Is it fair to blame Obama for war costs four months after he was inaugurated, or tax collections 10 days after he took office?

So the center built a baseline that includes everything that predated Obama and everything we knew about the path of the economy and the actual trajectory of spending through August 2011. Deviations from the baseline represent decisions made by the Obama administration. Then we measured the projected cost of Obama’s policies.

In two instances, this made Obama’s policies look more costly. First, both Democrats and Republicans tend to think the scheduled expiration of the Bush tax cuts is a quirky budget technicality, and their full extension should be assumed. In that case, voting for their extension looks costless, and they cannot be blamed for the resulting increase in deficits. I consider that a dodge, and so I added Obama’s decision to extend the Bush tax cuts for two years — at a total cost of $620 billion — to his total. If Obama follows through on his promise to extend all the cuts for income under $250,000 in 2013, it will add trillions more to the deficit.

The other judgment call was when to end the analysis. After 10 years? After the first term? We chose 2017, the end of a hypothetical second term. Those are the years Obama might be blamed for, so they seemed like the ones to watch. But Obama’s spending is frontloaded, and his savings are backloaded. The stimulus bill, for instance, is mostly finished. But the Budget Control Act is expected to save $2.1 trillion over the next 10 years. The health-care law is expected to save more than a trillion dollars in its second decade. If our numbers were extended further, the analysis would have reflected more of Obama’s planned deficit reduction.

There’s also the issue of who deserves credit for what. In this analysis, anything Obama signed is attributed to Obama. But reality is more complicated. The $2.1 trillion debt-ceiling deal wouldn’t have happened without the Republicans. But a larger deficit-reduction deal — one including tax increases and spending cuts — might have.

In total, the policies Obama has signed into law can be expected to add almost a trillion dollars to deficits. But behind that total are policies that point in very different directions. The stimulus, for instance, cost more than $800 billion. So did the 2010 tax deal, which included more than $600 billion to extend the Bush tax cuts for two years, and hundreds of billions more in unemployment insurance and the payroll tax cut. Obama’s first budget increased domestic discretionary spending by quite a bit, but more recent legislation has cut it substantially. On the other hand, the Budget Control Act — the legislation that resolved August’s debt-ceiling standoff — saves more than $1 trillion. And the health-care reform law saves more than $100 billion.

For comparison’s sake, using the same method, beginning in 2001 and ending in 2009, George W. Bush added more than $5 trillion to the deficit.

What is often assumed in this conversation is that all deficit spending is equal and all of it is bad. That’s not the case. Deficit spending when the economy is growing is different from deficit spending when the economy is in crisis.

Nor is all deficit reduction alike. Sometimes, cutting the deficit will expand the economy. Sometimes, cutting the deficit will shrink the economy. Which brings up some other questions Romney’s clock can’t answer: What number we should see on it now? And when, and how fast, should it start slowing down?

That will be the subject of next week’s column.