Producer Mark Ronson says that working on his massive hit Uptown Funk made him so ill he ended up slumped and sick in a toilet.

The 2014 song has been viewed more than 1.3 billion times on YouTube, went to number one around the world, and sold millions globally.

But the British producer says that he became so stressed out while struggling to complete the hit that he lost an inch off his hairline. Ronson said that after six months and 54 different versions of Uptown Funk he was still struggling to finish it.

"I had everything going on - hair loss, anxiety attacks, vomiting and finally collapsing in a restaurant." Ronson (40) told The Mail On Sunday's Event Magazine.

Ronson says the hit was conceived in "literally seconds of inspiration" in Bruno Mars's studio in collaboration with musician Philip Lawrence and producer and songwriter Jeff Bhasker.

Just in case you haven't heard it . . . 

"Jeff suggested going to a restaurant and then he asked me if I was OK because I looked incredibly white in the face," said Ronson, who rose to fame after collaborating with Amy Winehouse on her album Back To Black in 2006.

"I went to the toilets and just started vomiting, then I collapsed and had to be carried out of the restaurant. And then a couple of weeks later it [the guitar part] just came."