Knicks owner James Dolan is in a hurry.

According to an NBA source, Dolan sacked president Steve Mills two days before the trade deadline so he could begin researching and interviewing presidential candidates without having to do so in clandestine fashion.

The source said Dolan was not intending to renew Mills’ option after the season and wanted to get a jump on the interview process without it coming out in the media with Mills still in power.

Why the rush? The theory is Dolan wanted a head man in place by season’s end so he can lead a coaching search. Dolan hired branding consultant Steve Stoute partly to help him with the search.

The move still occurred at a bizarre time — off a two-game winning streak on the road and two days before Thursday’s trade deadline.

Mills negotiated with teams on trades up until Monday, according to the source, and several packages are in place for acting Knicks president Scott Perry to work on.

Trading Marcus Morris for a collection of assets and dealing with Golden State for point guard D’Angelo Russell are still on the table, according to the source.

Dolan’s fast pace doesn’t appear to bode well for the candidacy of Raptors president Masai Ujiri, who has been high on the owner’s wish list.

According to a source, Dolan has been leery of Ujiri using the Knicks as leverage with Toronto, given the mounds of publicity he has gotten as a candidate.

Ujiri’s contract expires in 2021, and the Raptors have every right to deny the Knicks permission to talk to him now. In 2017, after Phil Jackson got fired, Dolan called Toronto’s ownership and learned major draft compensation would be required, so Dolan moved on.

The source said Dolan reveres loyalty and still isn’t extremely keen on getting Ujiri to break his contract, requiring the Knicks to give up at least one first-round pick.

That could create a scenario in which Dolan makes an executive hire now and waits a year for Ujiri to become a free agent. The Raptors reportedly declined comment when asked if the Knicks had reached out to talk to Ujiri.

At practice Wednesday, Knicks interim coach Mike Miller, whose status is even more unclear, thanked Mills for hiring him to be the G League coach in 2014 and promoting him to David Fizdale’s NBA coaching staff last summer.

“Let me say this: First, I really want to thank Steve for everything,’’ Miller said. “When I was hired here five years ago to work for the Westchester Knicks, my final interview was with Steve and had a chance to talk to him. In my five years here, I’ve enjoyed working with him. He’s been so helpful to me and given me opportunities within this organization and to grow as a professional. So I appreciate everything Steve has done.”

Perry, the acting president, addressed the club before the start of practice. Perry did not address the media as he was working the phones.