If you get pulled over for drunken driving, you take a breathalyzer test — and are then arrested for driving under the influence. But what if you’re driving under the influence of marijuana?

Breathalyzers measure the percentage of alcohol in someone’s bloodstream and compares it to a set legal limit. While there’s no doubt that marijuana impairs abilities like reaction skills and alertness, there’s no set legal limit yet in Massachusetts.

Marijuana has been shown to impair performance on driving simulator tasks and on driving courses for up to three hours, according to the National Highway Traffic Safety Administration (NHTSA). But how do you measure if someone is too high to drive?

Michael Milburn, a psychology professor at University of Massachusetts Boston, has an app for that: DRUID.

“My goal has been to develop a tool that everyone is going to have with them, pretty much everyone has a phone,” Milburn said. “So they can do a self-assessment or [to] their friends. The equivalent of ‘friends don’t let friends drive drunk’ is that ‘friends make friends DRUID before they drive.’”

RELATED: Massachusetts becomes first East Coast state to legalize recreational marijuana

Massachusetts residents voted to legalize recreational marijuana on Nov. 8 and the law goes into effect Dec. 15, but with it comes the new legislative problem of identifying impaired drivers. In Colorado, which legalized recreational marijuana in 2014, the law states that the legal limit is five nanograms of active tetrahydrocannabinol (THC) in a driver’s blood for them to be prosecuted for driving under the influence.

“However, no matter the level of THC, law enforcement officers base arrests on observed impairment,” according to the Colorado Department of Transportation.

Milburn said that the issue with setting a legal limit of THC is that it doesn’t correlate to intoxication or impairment the way a blood-alcohol content does.

He explicitly doesn’t want Massachusetts to pass a law identifying a legal limit of marijuana, but as marijuana laws change here and across the country, law enforcement and legislators face new challenges until there’s a better system.

That’s why Milburn wants to focus on how impaired someone is. He hopes his app DRUID — a riff on “Driving under the influence of drugs,” he said — can one day help police officers determine this out in the field.

Some companies are working on a “marijuana breathalyzer” that would detect molecules of THC, but not only are those expensive to put in the hands of every police officer, Milburn said, they’re also inaccurate.

“THC is soluble so it stays in someone’s blood and body longer — weeks, months even after a person uses,” he said. “The thinking behind the marijuana breathalyzer is really flawed because its measuring molecules, not impairment.”

With alcohol, it’s pretty clear that as someone’s blood-alcohol content (BAC) increases, so does their impairment. With marijuana, it’s not. The NHTSA says that it’s difficult to establish a relationship between a person's THC concentration and how affected they are because it depends on their individual pattern of use as well as the dose.

Instead of focusing on detecting the amount of the substance in someone’s body, Milburn’s app tests impairment with four tasks that are similar to video games. They focus on testing reaction time, decision making, time estimation, motor tracking, divided attention and balance.

The DRUID tasks include stopping a timer after you think 60 seconds went by; following a circle on the screen with your finger while paying attention to squares that flash on the sides of the screen and keeping the device still in your hand as you balance on one leg.

At the end of the four tasks, DRUID gives the user a score of their overall impairment level — equivalent to a BAC. Currently, DRUID is only available for iPad; an iPhone version is in beta testing and should be ready in the coming weeks and an Android version will come later, Milburn said.

Because DRUID focuses on measuring general impairment, Milburn said it can identify effects of alcohol and prescription drugs — basically, anything that disrupts brain function that regulates reaction time, hand-eye coordination and so on.

“An important issue is that marijuana and alcohol disrupt different cognitive systems, so if you use just one of them, there's another part of the brain that can try to compensate a little,” Milburn said. “If you use both alcohol and marijuana, your impairment level is significantly higher than just one of them alone.”

RELATED: Marijuana-impaired driving case speaks to need for 'urgent' drug law, DA says

That issue affected a driver in a recent crash that killed two people. A man driving a car hit an airport shuttle bus, and two passengers were thrown from the vehicle. He was found to be under the influence of alcohol and marijuana, which prompted Suffolk District Attorney Daniel Conley to emphasized the importance for lawmakers to address marijuana-impaired driving.  

Milburn said that a legal limit isn’t helpful — for both marijuana and alcohol — because it’s not equivalent to impairment. An individual can be impaired with a BAC below .08, both he and Jake Wark, press secretary for Conley’s office, noted.

Still, Wark said, there is currently a systematic plan for measuring alcohol levels, which is ingrained in our legislative process.

“We don’t have [a plan in place] for marijuana. With the legislative landscape changing, it's an issue that lawmakers and policymakers will have to address.” Wark said. “The law already provides for the ability to prosecute impairment by THC, opiates, cocaine and methamphetamines, but Massachusetts is poised to legalize an intoxicating substance without a bright-line intoxication threshold.”

Milburn said that he called the Massachusetts Department of Transportation, the attorney general, state police and others to invite them to a demonstration of his app as a solution to this issue. He said no one responded, and no one responded to Metro requests for comment on that at the time of publication.