Depends on the environment. When I was at the main hospital as an intern on medicine rotation as the designated hospital team to respond to all codes, never once was I able to get to the room fast enough to even be involved. In that scenario, I'd just ignore it and finish the pooping. However, at the freestanding psych hospital I might be the only MD there, so I'd do whatever it takes to get there ASAP. Although, we've never had a code blue in the ~3 years I've been at my current spot. As an intern, I did have to initiate a code on the psych floor, but I got the hell out of the way when the code team showed up (very promptly).