You problem is when you getting the totalTimeLoggedIn
, you do:
long totalTimeLoggedIn = (((totalTimeArray.get(1) - totalTimeArray.get(0)) / 1000) / 60);
If you want to get the total time in second that generating using System.currentTimeMillis()
, then you have to divide just on 1000
,since the 1 second is 1000 milliseconds
, so you need to do:
long totalTimeLoggedIn = (((totalTimeArray.get(1) - totalTimeArray.get(0)) / 1000));