During our final year of medical training, I would take turns with the other senior residents responding to cardiac arrests in the hospital. We’d spend weeks camped out in the doctor’s lounge, our hearts racing at the prospect of a patient’s heart stopping, bracing for the moment a shrill pager or overhead speaker would signal an emergency.

When the signal came, two dozen clinicians of different ranks and specialties would descend on the patient’s room. It was then the on-call senior’s job to conduct an efficient, morbid, sometimes miraculous symphony to revive a patient whose heart had stopped beating.

The clinical aspects of running a code are straightforward, requiring little more than a handful of medications and a stopwatch. But the leadership task is exceedingly complex. Within seconds, the doctor in charge needs to impose order on a chaotic room rife with alarms, shouts, needles and tears. Who’s performing chest compressions? Intubating the patient? Checking lab work that might unearth a clue? Who would be alerting the I.C.U. that a patient will — hopefully — be transferred within minutes?

Most people think of doctors as scientists, caregivers or educators. But we must also understand doctors as leaders. Physician leadership is critical for better patient outcomes, clinical performance and professional satisfaction. That’s true not only during emergencies, but also for managing chronic diseases or improving hospital efficiency.