If you're an advertiser who wants to market a product to millennials, you're going to have to make it quick.

A new study by comScore revealed online ads targeted toward millennials have to be around 5 to 6 seconds to be effective, a sharp contrast from the traditional 30-second commercial seen on TV.

"The length of time of an episode or a viewing period is really important and has got to be short, otherwise you just won't keep the attention of millennials," comScore CEO Gian Fulgoni told CNBC's "Squawk Alley."

The format of advertising may have to be radically changed to reach millennials, he suggested.

"You're going to have to make your case literally in a matter of seconds and make sure you grab somebody's attention, Fulgoni said.

Millennials are spending the majority of their online time on mobile, according to the new study. Millennials said they spent 61 percent in smartphone apps and 8 percent on the mobile web. A quarter of their time was on desktop, and just 5 percent was spent on tablets.

As many other studies have shown, Snapchat was found to be extremely popular. Two out of 3 millennials were using the app, with 80 percent of the youngest millennials surveyed on Snapchat. It was also growing in popularity among older millennials.

Still, Facebook was the leader, with 95 percent of millennials surveyed on the platform.

"It's going to be interesting to see what happens over time, especially as these millennials age into the older segment," Fulgoni said.