You can spend a lot of accumulated time on your bottom in the course of a day. Or you can sit for lengthy spells without a break.

Both, it turns out, are very bad for you.

Whether you’re a heavy sitter or a binge-sitter, racking up prolonged sedentary time increases your risk of early death, according to a study published in the Annals of Internal Medicine.

That conclusion held up even after researchers took account of mitigating factors, such as time spent exercising. Even for people who hit the gym after a long day in a desk chair, sitting can be deadly.

The findings led the study’s authors to suggest that people who sit a lot should get up and move around every 30 minutes to counter the health risks that come with prolonged sedentary behavior.

The study team, led by Columbia University exercise researcher Keith Diaz, tracked the movements of close to 8,000 Americans older than 45 by asking them to wear an accelerometer on their hip.

Over a period of 10 days, sitting or lounging behavior took up the equivalent of 12.3 hours over a 16-hour waking day — about 77 percent, on average.

That’s a whole lot of sitting. But subjects differed in the extent to which they ­hunkered down for long stretches without getting up and moving.

After tracking subjects for four years, the researchers found that subjects who racked up the most time sitting were most likely to have died during the study period, and those who spent the least time sitting were least likely to have died. That was no surprise.

But when they looked at the death rates as a function of how often subjects went long hours without getting up, they saw a similar pattern: Those whose sitting bouts tended to be lengthier were more likely to have died than were those whose sitting spells tended to be shorter.

Make no mistake, the authors of the new research cautioned: “Accumulation of large volumes of sedentary time is a hazardous health behavior regardless of how it is accumulated.” But logging sedentary time in shorter bouts of sitting “is the least harmful pattern of accumulation.”

Study participants who racked up the most time in a chair tended to be older, were more likely to smoke, and were disproportionately black. They tended to be teetotalers, to have a higher body mass index, and were less likely to get much intentional exercise. They were also more likely to have diabetes, high blood pressure, worrisome cholesterol readings and a history of stroke, atrial fibrillation or coronary heart disease.

Such findings, of course, beg the question of which comes first — the immobility or the illness.

“Observational studies, no matter how well designed, cannot imply causality,” University of Toronto cardiologist Dr. David A. Alter warned in an editorial.

But the findings of this prospective population-based study do fit with those of experimental studies. In trials involving humans sequestered in research labs, scientists have shown that racking up prolonged, uninterrupted bouts of sitting and lounging cause more worrisome short-term changes in metabolic and cardiovascular function than sedentary behavior that’s interrupted by periods of physical activity.

“If you’re sitting too much, you need to do something about it — like right now,” said Dr. James A. Levine, an obesity expert at the Mayo Clinic who studies the health effects of sitting. “Unless you get moving now, you’re in trouble later.”

The finding that a workout will not undo the harms caused by prolonged sitting is unsurprising, Levine added.

“Even if you’re a gym-goer and think you’re safe on account of your excellent effort, you are not,” Levine said. “No one gets away from this stuff. … Excess sitting, this study seems to suggest, is a death sentence.”

In his editorial, Alter worried that people intent on reversing patterns of sedentary behavior will have a lot on their plates.

To live longer, healthier lives “may require us to count the total number of hours we are sedentary per day, the total number of minutes we sit at a time, the total number of standing breaks we take per hour, the total number of steps we take per day, and the total metabolic equivalent of task-minute volume of exercise we achieve per week,” he wrote.

“Yikes! That sure is a lot of counting over the course of a lifetime — all to reverse the evolutionary patterns of a society gone lazy,” Alter added. “Might it not just be easier to return to our origins as hunters and gatherers?”