“Last year I wasn't sure If I'd be racing and it wasn't my choice,” the 35-year-old Briton told Sky Sports television.
“This year it was totally my choice and there was a moment where I thought 'I am not sure I want to do this anymore and be where we are'. Obviously if we are where we are right now next year it is not going to be that enjoyable.”
McLaren, the second most successful team after Ferrari in Formula One in terms of race wins, finished ninth of 10 this season.
The team has not won a race since 2012, with 2009 champion Button the last to do so, and its new partnership with Honda has been plagued by unreliability and a lack of performance that has seen the Briton and Spanish team-mate Fernando Alonso languishing near the back.
There was considerable speculation earlier in the year that Button would announce his retirement but instead the most experienced driver on the starting grid, who made his debut in 2000, signed up for another season.
“I spent a lot of time with the engineers and the aerodynamicists and I spoke more with Ron in the two months when I was trying to decide what to do next year than I have in my whole time at McLaren,” said Button.
“So that got me excited, that got me pumped for next year knowing that there are big improvements on the horizon, and we need them.”
Alonso has two more years on his contract but Dennis told reporters last month that a possible sabbatical had been discussed if the car remained uncompetitive. The Spaniard subsequently ruled that out.
Original source: Jenson Button nearly quit F1