Having high cholesterol in your 30s and 40s increases your risk for heart disease, and the longer it stays elevated, the greater the risk, a new study reports.

Researchers studied 1,478 people, average age 55, who were free of cardiovascular disease. All had had their cholesterol levels measured periodically over the previous 20 years. The scientists followed the group for the next 15 years, during which 155 developed cardiovascular disease.

The study, published Monday in Circulation, recorded how many years each of the subjects had had elevated cholesterol levels. (The researchers measured non-HDL cholesterol levels, or total cholesterol minus HDL, with a level of 160 or above considered high.)

After controlling for sex, smoking, diabetes and other factors, the study found that cardiovascular disease rates increased 4.4 percent for those who had never had elevated cholesterol, 8.1 percent for those who had had it for one to 10 years, and 16.5 percent for those who had had it for 11 to 20 years.

“The duration of exposure plays a role,” said the lead author, Dr. Ann Marie Navar-Boggan, a cardiology fellow at the Duke Clinical Research Institute. “Suppose you have two adults, both 55, same cholesterol, same blood pressure and so on, but one has had high cholesterol for one year and one for 11 years. The person who has had it for 11 years has a 39 percent increase in risk.”

Should people in their 20s and 30s be taking statins if their cholesterol is high? Dr. Navar-Boggan said there was no long-term data on the safety of taking statins over decades of life.

But, she added: “The foundation for heart disease starts early on, and having high cholesterol over decades is bad for you. Now it’s time to study the potential benefits of long-term treatment with statin therapy.”