Among Michael Phelps’s revelations were his attitude toward swimming four years ago. “Back then, in 2012, I wanted nothing to do with the sport. I was completely finished. Ready to move on. Ready to retire.” (Alex Menendez/Getty Images)

BEVERLY HILLS, Calif. — Proclaiming himself in a happier, healthier frame of mind than he has been in years, Olympic champion Michael Phelps said Tuesday that he will be at peace with his results at the 2016 Rio Games regardless of the outcome, knowing that he has prepared to the best of his ability.

That commitment to doing everything he can to succeed in Rio stands in sharp contrast to what Phelps characterized as a half-hearted approach to the 2012 London Games.

“In 2012, it was like pulling teeth,” Phelps said in a wide-ranging press conference at UCLA’s Pauley Pavilion, held in conjunction with the U.S. Olympic Committee Media Summit. “It was brutal. It was hard to get me in the pool.”

Nonetheless, Phelps won six medals in London, becoming the most decorated Olympian in history, and retired immediately afterward, with 22 Olympic medals (18 of them gold) and no plan for the next phase of his life.

“Back then, in 2012, I wanted nothing to do with the sport,” Phelps said. “I was completely finished. Ready to move on. Ready to retire.”

Phelps, who’ll turn 31 in June, was open and expansive Tuesday, declaring no topic off limits and hedging only when asked which events he intends to race in Rio, which will be his fourth and final Olympics.

He referred several times to becoming a father for the first time and the pride he’ll feel knowing that his son, who is due in May, will be able to see him compete for the final time.

He spoke of his happiness over rekindling a relationship with his estranged father, with whom he now speaks weekly. And he talked with pride, and a bit of awe, over how good he feels physically to have not had a drink of alcohol for nearly a year and a half.

“I see a compete change in my body; a complete change in how I am day to day,” said Phelps, who in December 2014 pled guilty to a drunken driving charge for the second time in 10 years. “Completely clear headed. I don’t have a headache, which is really awesome. All those small things that really add up. … I’m actually happy every day. Able to be productive every day. That’s something I’m able to be very proud of.”

Phelps flew in for the Tuesday evening press conference after a long workday that began in a pool at 7 a.m., followed by an appearance at Under Armour’s Baltimore headquarters. Phelps described the company’s founder, Kevin Plank, as a longtime friend, quasi-father figure and source of profound inspiration.

While he declined to say which races he hopes to run in Rio, Phelps said he is doing everything possible to deliver the best performance he has in him — from his 30-hour work weeks in the pool and gym, his recovery exercises afterward, his careful attention to diet, abstinence from alcohol and early bedtime.

“When this summer is over, as long as I’m able to look back and say I did everything to get ready, it doesn’t matter what happens,” Phelps said. “If I’ve done everything I can to prepare myself for these Olympics, I’m happy with that. That’s all I could have done.”