Howto track laptop uptime


I want to track uptime of laptop daily activity, i.e time from powering on or waking up from suspend till shutdown or suspend, excluding lock screen time. I tried Linux build-in tool uptime but it tracks whole time including supend and lock screen. Any ideas howto track such time combination in Linux? Thanks in advance.

OS: Xubuntu 14.04

I’m using RescueTime to track how much time I spend on my computer (and mobile devices). You only get hourly aggregate stats, not exact timestamps for each session, but it works well otherwise.

Thanks, for respond. So what you need is just to launch RescueTime and it will track working hours automatically? I mean do you need to manually switch off RescueTime when you want to lock screen and let’s to have some cofee? What I need just to run application and it should track activities automatically?

RescueTime assumes you’re away if you’re not typing or moving the mouse for a certain amount of time, and might also detect when you lock the screen, but I’m not sure about that. Their support is pretty responsive, so I’d suggest asking them.

You could set up a cronjob that reads some stats from you computer and appends that to a simple txt file. Not only you know when you were on the computer but you also get some cool metrics like battery health etc.

RescueTime is great and you can find other options here: