APM don't count correctly

There is a bug with apm counter (apm goes way too high for doing literally nothing, it can get even to 20-30k). Example when it occurs: i have some units on my control group 2. then i select some of that units, and hold alt+1 for a while. While i holding it, my apm showing like its 3k. So i cant really examine, was a player fast, or it was just a bug.