The concept of APM is independent from Starcraft and from Blizzard, so it cannot be based on Blizzard's "in-StarCraft2" game time...
However the APM values seen when watching a replay are calculated by StarCraft II using game time. This makes these APM values be uncomparable to values seen/coming from other games.
There are tools which can calculate and show APM values using "real" or normal time, Sc2gears is for one. Sc2gears can calculate and show APM values using both game time and real time (you have the option to choose, real time is the default).
The Sc2gears home page has a nice description about the different types of APM (including info what you can see in StarCraft 2 and how they relate to the Sc2gears APM values):
https://sites.google.com/site/sc2gears/features/replay-analyzer/apm-types