(CNN) Worried that coffee will make your heart go pitter-patter, and not in a good way? A new study puts to rest the fear that your daily fuel will cause heart palpitations -- or cardiac arrhythmia, as doctors call it.
In fact, a habitual coffee habit was associated with a lower risk of developing an arrhythmia, such as atrial fibrillation in which the heart races, or flutters in the chest, the study found.
The study, published Monday in JAMA Internal Medicine, analyzed coffee consumption by more than 386,000 people over a three-year period and compared that with rates of cardiac arrhythmia, which might include atrial fibrillation.
After adjusting for demographics, lifestyle habits and diseases and conditions that might cause heart flutters, "each additional cup of habitual coffee consumed was associated with a 3% lower risk of incident arrhythmia," wrote corresponding author and arrhythmia specialist Dr. Gregory Marcus, a professor in the division of cardiology at the University of California San Francisco, in the study.
The researchers also looked at genes known to be associated with coffee jitters.
The CYP1A2 gene, sometimes called the "coffee gene," aids in the metabolism of caffeine. People with a fully functioning gene -- which can be affected by lifestyle habits such as smoking -- metabolize coffee at a normal rate. That means they can, for the most part, drink coffee without ill effect.
But when that gene mutates, the rate at which the body metabolizes coffee might slow down, and the coffee high could last longer or be felt at a greater rate.
In its genetic analysis, the study did not find any significant association between an impaired coffee metabolism and arrhythmia risk.
The notion that coffee causes the heart to flutter was born from older, small studies, including one that focused entirely on male physicians, wrote Marcus and his team from the University of California San Francisco.
Today, science has a different view. In fact, a "review of 201 meta-analyses found that moderate consumption of coffee is likely more beneficial than harmful to health," Marcus wrote.
Also, a number of "possible health benefits of caffeine and coffee in particular have emerged, such as reduction in cancer, diabetes, cardiovascular disease and overall mortality," according to the study.