Time being logged when computer is sleeping
Yesterday, I checked the weather and decided to go out, and put the computer to sleep. When I came back, I waked the machine, and RescueTime now shows one hour and a half on weather.yahoo.com.
I had this happen again today for less than one hour.
However, it seems to be working fine when the machine sleeps for more than 4 hours. The time is not being logged in that case. (I've not tried sleeping between 1:30 and 4h, so the limit, if any, should be within)
The more people who report this problem, the more it gets noticed.
-
Inappropriate?There are some instances with the Mac data collector where it is not properly detecting when the system sleeps. I think it has to do with a timing issue, I'm looking into it and hope to have a fix soon.
Thanks! -
Inappropriate?Hi, I'm seeing this on a Powerbook g4 with 10.5.2 and for now I'm working around it by bringing stickies to the front before I put the computer to sleep, so I can easily delete any spurious sleep-time.
My apologies if you've already seen this and it's not the issue, but Apple dev QA 1340 discusses getting sleep notifications from the system:
http://developer.apple.com/qa/qa2004/...
I’m inconvenienced
-
Inappropriate?Thanks for the link Michael. That link shows how RescueTime attempts to register sleep events now, unfortunately, due to the single threaded nature of the current RescueTime application, certain things can cause the system to sleep before RescueTime can react which throws the logic out of sync.
Just today I completed a number of code changes surrounding sleep issues that I am testing.
If you (or anyone else on this thread) are interested in helping me test the new sleep routines, email me at team@rescuetime.com and I'll send you the current beta build. Otherwise, I hope to have it tested and a release sometime this weekend.
Thanks! -
Inappropriate?Joe, thanks for the reply. I've sent you an email about the beta.
I figured it was something more complicated than just finding the right API, but I thought it couldn't hurt. And now I've bookmarked the sleep notification for when I need it :) -
Inappropriate?Another way to do this, simpler, and I think more robust is like this: I understand RescueTime checks for the current application every two seconds. If you just record the current time when you perform your check, you can measure the elapsed time between two checks. It should always be around two seconds, except in the cases when the machine has gone to sleep during the process. You can say that if the sleep(2) takes more than 1 minute, the machine was sleeping, and discard this period.
-
Inappropriate?Great thinking Thomas, which is pretty much exactly what I've changed to code to do.
So instead of a function of isSleeping, I now use one called wasSleeping - which checks the lastScanDateTime with the currentScanDateTime and if they differ by an amount over 60 seconds it updates the old record with the lastScanDateTime and creates a new record with the currentScanDateTime.
I had to use both date and time due to sleeping over a date change period, but essentially it's exactly as you laid out above.
Thanks!
Loading Profile...




EMPLOYEE
