Would you drink another cup of coffee or slam down another energy drink if you knew exactly how much sleep the added caffeine would cost you? Would you skip that afternoon trip to Starbucks (SBUX 1.00%) or Dunkin' Donuts (DNKN) if you had an app that showed you proof that drinking coffee after lunch made it harder for you to go to bed that night? 

Jawbone hopes you do. The company has introduced UPCoffee, an app that lets you track your caffeine consumption and the impact it has on how you sleep. The app, available on Apple's iOS only, works on its own or in conjunction with Jawbone's UP and UP24 band -- a sort of bracelet that tracks movement and sleep details.

"The stand-alone application helps you understand more about your caffeine choices by correlating caffeine intake and projected sleep time. Simply log a coffee, tea, energy drink, or other caffeinated beverage in the UPCoffee app to see a visual display of where you fall on a spectrum from "Wired" to "Sleep Ready" at any given time," Jawbone said in a press release.  "When linked with data from your UP or UP24 band, UPCoffee analyzes how your caffeine intake affects your sleep patterns. After tracking both caffeine intake and sleep for 10 days, UPCoffee can tell you things like the amount of sleep you lose on average for every 100mg of caffeine you ingest."

Is caffeine bad for you?

Doctors seem to disagree as to exactly how much caffeine people should consume each day.

"In moderation caffeine is OK, but people with heart conditions, especially arrhythmia, as well as those who suffer certain psychiatric disorders like anxiety disorders, should be extra careful," according to Dr. Prakash Masand, a psychiatrist who is president of Global Medical Education, and a former consulting professor at Duke University, in an interview with the Fool.

Masand said that according to DSM-5, the diagnostic manual for psychiatric illness, a high dose of caffeine is that greater than 250 mg. "The consumption of which, in some individuals, can lead to restlessness, nervousness, flushing, increased heart rate, periods of inexhaustibility, sleep disturbances, arrhythmias, and excitement – all signs of caffeine intoxication. Long term, it can also lead to bone loss and increased risk of fractures."

Steven Masley, MD, CNS, and author of the forthcoming book, The 30-Day Heart Tune-Up told the Fool that one to two servings of caffeine per day "are good for your brain. Side effects occur when people have from anywhere from one to three servings per day. More than three servings per days can increase blood pressure and cholesterol levels."

He defined servings as one cup of regular coffee, five ounces of Starbucks filtered coffee, or 16 ounces of tea.

Alan Kaplan, MD, director of emergency medicine at Plainview Hospital on Long Island, NY, takes a harder line than his colleagues.

"There is no 'healthy' amount of caffeine consumption," he told the Fool.

People don't know when to stop

Where UPCoffee comes into play -- and where widespread adoption of the app could cause problems for coffee-sellers including Dunkin' and Starbucks -- is informing people when they have had too much caffeine and showing them the consequences.

"Consumers in general don't know how much is too much," Masand told the Fool. They also, he said, don't know the difference between how much caffeine various products have -- something the app tracks.  

Dr. Rob Paul, a board-certified clinical neuroscientist, echoed that opinion.

"Consumers are generally not aware of how much is too much and they also are generally not aware of the various sources of stimulants in energy drinks that adversely potentiate the stimulant properties of caffeine (e.g., guarana)," he told the Fool.

How much do Starbucks and Dunkin' Donuts stand to lose?

In 2013 Starbucks had $14.89 billion in revenue while Dunkin' Donuts reported $9.27 billion in franchisee-reported sales . Starbucks reported that 74% of its business was beverage sales (the company does not break down what beverages were sold), with another 3% of sales coming from packaged and single-serve coffee. Dunkin' does not break its sales down that way.

Clearly not all of Starbucks' beverage sales are caffeinated, but with 77% of revenue coming from beverage and packaged/single cup sales that's nearly $14.5 billion. It's silly to think one app will massively dent that market. But if customers become more aware of how caffeine impacts them -- specifically if they learn how much sleep that extra cup will cost them -- it could cause people to cut back.  

Coffee purveyors have always benefited from the widespread belief that caffeine was generally a good thing -- something that helped you get through the day. If products like UPCoffee begin to change that perception, it could snowball. The market for cigarettes plummeted when education took hold, and for a while at least negative perceptions of carbohydrates caused huge business dips for companies like Krispy Kreme Doughnuts (NYSE: KKD).

All sorts of products -- think eggs, milk, and even juice -- have fallen victim to this type of mass thinking. Starbucks and Dunkin' Donuts need not fear UPCoffee, but they should worry about caffeine becoming the villain of the moment.