Pollux you could, but then the user profile would say they were last seen 5 minutes ago, which wouldn't be correct either.
IMO this is all useless in the end because every time you see an online indicator, that value isn't updated in real time anyway. If you load a discussion, all the indicators on the page are based on the last seen time of the user as updated during page load. As you stay on the page, user indicators will start disappearing based on how long ago they were seen compared to the page load, meaning even before the 5 minutes are up, many indicators will disappear. As soon as the page finished loading, every information is already "wrong". Unless you are actively refreshing a user profile page to see when they become offline, the 5 minute delay is nothing compared to the fact the value isn't updated in real time anyway.
If you have extensions that require accurate online measurement, like an online user list or live messaging, then that extension will need to implement a proper online system already. You cannot rely on the last activity alone to know if the user has the page opened or in focus.