To put the roller-coaster presidency of Donald Trump in perspective, it helps on occasion to imagine that Hillary Clinton won the election. My experience is that the exercise leads to greater appreciation of the president we have, warts and all.

Start with Clinton herself. She has spent the last 18 months in a perpetual snit. “No, I’m not over it,” she confessed while turning Yale’s commencement into a self-pity party.

Anyone who has dealt with her knows the “I’m a victim” shtick didn’t start with November 2016, and would not have ended if she had won. She’s been a blamer and finger-pointer her entire public life and would have taken her woe-is-me attitude to the Oval ­Office.

Coupled with her breathtaking sense of entitlement, it is hard to see her presidency lifting the ­nation’s self-confidence, at home or abroad.

In economic terms, how much higher would unemployment be? How about the stock market and median family incomes — how much lower would they be?

Remember, Clinton promised — promised! — to put coal miners out of work. That’s a promise she probably would have kept.

She wanted to raise taxes instead of cutting them and loosen already lax immigration policies instead of tightening them.

She was part of President Barack Obama’s team that tried to force Israel to make concessions its leaders believed were dangerous to the Jewish state’s security. It’s a cinch the US Embassy still would be in Tel Aviv instead of Jerusalem and Palestinians would have kept a veto over our policy.

The Iran deal would be unmolested by a Clinton presidency, leaving the mullahs free to be ever more aggressive in their pursuit of regional power.

It’s true a President Clinton would be more popular in Western Europe than Trump is, but that’s because there would be no America First agenda. Allowing Europe to call the global shots would make appeasement the ­default position.

Then there are the aggressions of China and North Korea. Breathes there a soul who believes Clinton would have pushed back harder than Trump?

Of course, Stormy Daniels wouldn’t be famous, but perhaps Clinton’s friend and donor Harvey Weinstein would still be on the prowl and the #MeToo movement would not exist.

Among other consequences, consider the extraordinary political and legal aftermath of the election, ranging from the resistance to Robert Mueller’s investigation to the emerging evidence that the FBI and CIA conspired to spy on the Trump campaign.

My first impulse is to assume Clinton would have fired FBI boss James Comey faster than Trump did. Then I wonder because of what Comey had on her.

It’s not just that he let her skip on having classified emails on her home-brew server. There were also the aborted FBI probes into the pay-to-play evidence involving the Clinton Foundation and Bill Clinton’s enormous speaking fees while Hillary was secretary of state. Somewhere, Comey surely has a secret file on Clinton’s legal and political ­vulnerabilities.

Suppose then, in true J. Edgar Hoover fashion, Comey signaled he would spill the beans if he lost his job. It’s legal blackmail, and it’s possible that’s what Comey tried to do with Trump by telling him about the Russian dossier — using unverified allegations as personal leverage.

A victorious Clinton would have remained furious at Comey for ­reopening the email investigation in October. But having realized her dream of sitting in the Oval Office, her anger could have been reduced to a footnote and she might have decided she was best served by letting Comey keep his job — and his secrets.

Of all the possible scenarios, there is one about which we can be certain: A Clinton victory would have kept the public from learning about the Obama administration’s extensive abuse of its powers to help her.

Her victory would mean Stefan Halper, Carter Page and George Papadopoulos would remain anonymous private citizens, and key players involved in the scheme would still have their ­reputations intact.

Loretta Lynch, for helping to minimize the various probes, might be Clinton’s attorney general. John Brennan, James Clapper, Susan Rice and Samantha Power might have important government jobs instead of having to fight to keep their dirty tricks buried.

Mueller would be in private law practice, the highlight of his bio being that he was the longest-serving FBI director since Hoover. Instead, his legacy is now tied to his drawn-out investigation of the president that is falling out of public favor.

As for Trump, a Clinton victory would have been devastating, but he probably would have started a new media company and created his own form of a resistance. Given his Midas touch, a loss could have been the most profitable deal of his life.

But fate and voters had other ideas, and the truly remarkable fact is that Trump’s stunning Electoral College victory came despite the alliance against him involving the White House, law enforcement, the intelligence agencies and the media.

In coming days, we will learn more about that squalid alliance, giving us more reason to marvel at the resiliency of our republic. And even when it looks as if Trump is running off the rails, consider the alternative and remember this: It would have been worse. Much worse.

Contempt for us all

Mayor Putz is so predictable. Weeks ago I guessed he was refusing to turn over his emails to private consultants simply because they were embarrassing.

So they are — though I underestimated how callous he is in private. Thanks to The Post and NY1 for waging a three-year legal battle, we know Bill de Blasio was hiding his contempt for Gov. Andrew Cuomo, the media and even his job.

The emails show him fixated on “the politics and optics,” with little talk of the actual substance of being mayor. Let somebody else worry about the homeless — he was worried about making himself look good despite the problem.

He hates the media coverage he gets and decides it’s because newspapers are privately owned. How telling: He earlier said government should control private property, and now speech, too. He’s obviously no fan of the Constitution.

Face facts, New York: Being mayor interests him only as a steppingstone to his next job. The sooner he gets one, the better.

Lest we forget

Did you know there are 25 US military cemeteries and 27 memorials and monuments in 16 foreign countries and territories? They hold the remains of 218,000 individuals who died there during World Wars I and II.

The grounds are hallowed by the blood of heroes, without regard to rank, creed or race. Promise yourself to visit as many as you can.

My visit to Normandy will stay with me forever. May those who died defending America’s freedoms rest in eternal peace.

Twit nitwits nixed

Thank you, Twitter. Your vague messages about “unusual activity” on my feed and vexing demands to change my password reminded me I have better things to do with my time.