Anyone competing counts it out before they start the stage. That's a different scenario. If you have to take unexpected extra shots on target, you make the adjustment on your planned mag change on the fly.
But count rounds? You're hurting your training if you count rounds.
Your mantra for training any skill should be "I practice these things so that I may forget them." That may be Bruce Lee who said that or something similar. Counting rounds is trying to remain conscious of what you're doing when you need to act almost unconsciously.
Conscious thought takes time. Conscious thought is language - - it's speaking inside your head - and your body is capable of acting with far greater speed and skill when that conscious thought is minimized. Conscious thought is a waste of time when trying to employ a skill at speed.
If you're counting rounds in a defensive scenario, OR practicing for a defensive scenario, you're effectively slowing yourself down. You're hurting your practice, and distracting yourself from the task at hand: shooting, moving, and acquiring targets. Even if you can imagine scenarios where the certainty of having just X number of rounds left could make a difference, those are far outnumbered by scenarios where quick intuitive action is more important, and you're not going to train to your potential while actively thinking.
And if you don't know when your slide locks back by the feel of it when it happens, you're not shooting enough.
Also, as I sit here thinking about scenarios where it might matter, this simple thought occurred to me:
If you are in a true defensive scenario, in what possible situation would you need to fire a round at someone and NOT fire that round because of how many you have left? And if you're going to take that shot regardless of how many rounds you have left, then how could it be important that you know EXACTLY how many you have left? You'd be making the same shots anyway.