in reply to tracking transient data in memory by countdown timer

Sort the array of users by last activity time and the next dropout will always be at the start (or end depending on sort order) of the array

Every second check the first (or last) entry for expiry and update your summary. If you don't mind a small inexactitude, just use sleep(1) to wait a second

  • Comment on Re: tracking transient data in memory by countdown timer