Updated

Katy Perry gets candid in her new cover interview for Billboard magazine, in which she admits to suicidal thoughts after her split with ex-husband Russell Brand, explains a less than friendly encounter with Barbara Walters and also reveals the extent of her infatuation with boyfriend John Mayer.

While discussing her new album "PRISM," Perry talks about some of the darker material, including "By the Grace of God," which according to Billboard, has the pop star "lying on the floor of a bathroom, fighting suicidal thoughts."

Video: Katy Perry Fashion Time Warp

"That song is evident of how tough it really was at a certain point. I asked myself, 'Do I want to endure? Should I continue living?'" Perry says. "All the songs are real-life moments. I can only write autobiographically. I put all the evidence in the music. I tell my fans if they want to know the real truth about stuff, just listen to the songs."

Her divorce also took a toll on her work-life, as evidenced by a sit-down interview with Walters that turned out to be less than ideal.

More On This...

"I shouldn't have done the interview: I was playing Madison Square Garden that same night, and I knew that the end of my marriage was coming. I was just exhausted and stressed," Perry explains.

And when the legendary broadcast journalist was left waiting because of a scheduling miscommunication, she didn't hesitate to give her a piece of her mind.

"I'd prepped everyone that I was running late, but Barbara showed up at the original time anyway. When I got there, I apologized immediately, but then she said to me, 'You know, I've only ever waited for one other person this long, and you know who that person was? Judy Garland. You know how she turned out, right?' I was like, 'Oh, snap! Yes, b****!' I think it's the coolest thing that Barbara Walters shaded me."

Though according to Perry, Walters should have given her "a break."

"I just couldn't tell her as we were sitting down for a mega-interview, 'Hey, my marriage is falling apart. Give me a break.'"

Video: Behind Katy Perry's Epic Killer Queen Commercial

The chart-topper also gushes about Mayer in the interview, who she refers to as a "genius."

"He literally is a genius, as is evident from his songwriting," she says. "I always tell him, 'Darling, you know I'm going to have to give your mind to science after you've passed, because we're going to have to understand how all these sparks work.'"

And she's not shy when it comes to dishing on some of their at-home habits.

"We'll be in bed, and he'll be doing the crossword puzzle. Every night, he tries to finish it in under 10 minutes. When he puts his mind to something, he really gets it done very well. I always ask for his help."