They’ve prepared for an earthquake. They’ve prepared for a terrorist attack striking the Golden Gate Bridge. They’ve helped their city weather plane crashes and mass shootings.

But San Francisco officials haven’t prepared for something quite like this — a virus that could kill thousands of people and crush the health care system and economy while it’s at it.

It sounds like a bad horror flick, but it’s all too real.

“This whole thing is moving faster than anything that’s ever happened to us before,” Supervisor Aaron Peskin said in an interview Tuesday night after he staffed the emergency operations hub at Moscone Center with hundreds of other city workers. “Our emergency response was never built for this, and now we’ve got to adjust it hour by hour and day by day.

“I’ve never, in 20 years, been to a training about a pandemic,” continued the supervisor, who served on the board from 2001 to 2009 and again starting in 2015. “Nobody’s ever been to a rodeo like this before.”

That’s the truth. San Franciscans could be excused for doubting their notoriously slow, deliberative leaders could rise to the massive coronavirus challenge in any kind of quick, decisive way. But, mostly, they have — and our city continues to be better positioned to weather this misery than any other city in the country. For instance, New York City has seen coronavirus cases skyrocket in recent days, and hospitals there are overwhelmed — a surge that hasn’t happened in San Francisco. Yet, anyway.

In large part, that’s because Mayor London Breed’s declaration of an emergency Feb. 25 allowed city government to toss much of its red tape and mind-numbingly dumb rules and actually get things done.

“That’s really the kind of thing this directive has given us — the ability to spring into action fast,” Breed said in an interview. “We need supplies now. We need nurses now. We don’t have time to wait.”

Before this crisis, it took nine months, on average, to hire a single city employee. That timeline has long infuriated department heads who need nurses, case managers and bus drivers immediately. But as of Monday, the city had hired 82 new nurses in the previous two weeks.

The city has long been short on hospital beds, particularly for those suffering psychiatric emergencies, but took years to add a few dozen here and a few dozen there. This week, Breed announced she asked the state and federal government for 5,000 more hospital beds.

Opening 130 beds in a Navigation Center on the Embarcadero in December took 10 months — featuring angry community meetings and a nasty lawsuit. Six hundred homeless people will move into Moscone Center with medical care for drug addiction, mental health issues and physical health issues any day now. Planning took mere weeks, and nobody seems to care if grumpy neighbors don’t like it.

It took six months last year to turn a parking lot into, well, a parking lot — for homeless people living in 30 cars and RVs. This month, Breed quickly secured 30 recreational vehicles to serve as isolation housing for people with the coronavirus who don’t need to be hospitalized.

And the list goes on. Basically, city officials have turned from slow joggers who rarely seem to reach the finish line into sprinters who don’t know where the finish line is but keep charging ahead nonetheless.

“That soul that everyone’s talked about us losing? We haven’t lost it,” said Supervisor Hillary Ronen. “We just haven’t been acting like ourselves lately. During an emergency, we remember who we are.”

At the urging of Dr. Grant Colfax, director of the city’s Department of Public Health, City Hall took fast action far earlier than other American cities. He’d been tracking the early coronavirus cases in China back in December and pushed for the January creation of an emergency operations center at the Department of Emergency Management’s headquarters on Turk Street.

“It was so important for us in San Francisco to get ahead of this, to get ahead of the curve before there even was a curve in San Francisco,” Colfax said in an interview. “If you look at our responsiveness in the last number of weeks, I can reassure you we will be as responsive in the future.”

On March 5, the city announced its first two cases of the coronavirus. When I talked to Colfax last week, there were 51 cases in San Francisco. On Thursday, there were 223.

As the crisis grew — and people had to sit 6 feet apart — the Turk Street facility became too small, so hundreds of workers are now stationed at the emergency hub inside the spacious Moscone Center. Twenty-six departments have workers based there, and the Board of Supervisors is sending one of its 11 members and a couple of aides there each week to get answers to questions from their fellow supervisors and constituents.

City staff have stopped asking each other, “How are you?” because, in truth, the answer is never good. Many are working 15-hour days, with no days off. They’re so tired and emotionally drained, they cry easily.

“I don’t know how we’re still standing,” said Mary Ellen Carroll, the director of the Department of Emergency Services, who is running the show at the Moscone Center.

She said staff are encouraged to take self-care measures such as regular stretching, staying hydrated and eating well. Colfax recently told the group that when he feels overwhelmed, he moves to a different room and counts to 10.

Carroll said she gets up at 5 a.m. and runs in the empty streets in the dark.

“One thing that is helpful is that we try to remember that it will be over,” she said. “There’s no question in my mind that as we look back, we are going to be so proud of what we did.”

It hasn’t been perfect, of course.

Peskin said he asked landlords to donate hand sanitizer and other hygiene items to give to single-room-occupancy hotels that need them. He was told he’d have to file paperwork to the Ethics Commission disclosing the items as gifts — I mean, come on — so he just delivered the supplies on his own.

And Ivy Lee, a legislative aide for Supervisor Norman Yee who is also staffing the emergency center this week, said the city has learned that some SROs don’t even have sinks in their bathrooms for handwashing.

Homeless shelters have been given mixed messages from the city about the importance of social distancing — and lack such basic supplies as thermometers. Testing patients at Laguna Honda for the virus has been slow despite six staffers testing positive.

Still, even the toughest City Hall critics are impressed with the response so far.

“The whole paradigm is shifting with regards to homelessness,” said Jennifer Friedenbach, director of the Coalition on Homelessness. “The virus has driven it home for a lot of people, why it’s so important that we solve this humanitarian catastrophe. If we can hold that energy, we can go really far.”

While nobody could be asked to work at this pace permanently, hopefully the energy and can-do attitude will last long after the virus has passed so the city can address its myriad other emergencies: homelessness, drugs, mental health issues, property crime, traffic deaths and lack of affordable housing, to name just a few.

I’m looking forward to the time when we can go back to simply worrying about all that.

San Francisco Chronicle columnist Heather Knight appears Sundays and Tuesdays. Email: hknight@sfchronicle.com Twitter: @hknightsf