The conversation on this page has been archived and is no longer active.

MacOS X: recorded time when going to sleep?

Message #1 - Posted 2005/12/27 - Martin Frost me at invalid ...

Is there a way under MacOS X to tell when the computer last went to sleep?

The 'uptime' shell command shows how long the system has been up (including time sleeping, it seems).

And /var/log/system.log records the time of each "System Wake" (but it records "System Sleep" with the actual wakeup time, not the going-to-sleep time).

Martin

Message #2 - Posted 2005/12/29 - Graham Miln

Previously, Martin Frost me at invalid stanford daht edu wrote:

Is there a way under MacOS X to tell when the computer last went to sleep?

Our product DssW Sleep Monitor will keep a log of your computer's sleep periods.

Sleep Monitor 2.1
<http://www.dssw.co.uk/sleepmonitor/>

Alternatively, you need to build a daemon that registers an interest in sleep and wake events.

Power Management for Macintosh; getting started
<http://developer.apple.com/technotes/tn2002/tn2075.html>

Using Cocoa, look for NSWorkspaceWillSleepNotification and NSWorkspaceDidWakeNotification notifications.

Kind regards,

Graham

mailto:support@dssw.co.uk
http://www.dssw.co.uk/ Mac energy saving and power management software

Need Help? Have a Question?

Looking for more help, comments, and answers?

Ask your questions on Ask Different. Ask Different is a community of Apple users ready to help.