Program/Widget to track actual battery run time on MBP?

Discussion in 'MacBook Pro' started by eyespii, Mar 24, 2008.

  1. eyespii macrumors 6502

    Joined:
    Mar 8, 2008
    #1
    Exactly as the title says - is there a program out there that can track how long my MBP is running when i run it off of battery power? As we all know the power usage varies depending on what you're doing on the computer, and I don't tend to do any one thing for hours on end. I know on my windows PC i used some program that charted on a graph power usage over time until the battery died.

    Thanks in advance!
     
  2. dallas112678 macrumors 6502a

    Joined:
    Feb 17, 2008
    #2
    iStat Pro on the apple website. Tells everything from CPU usage, to fan speed, to how long you have left for your battery. It tells you how long you have down to the minutes on battery power and changes automatically if your doing something more or less intensive, nice widget to have.
     
  3. eyespii thread starter macrumors 6502

    Joined:
    Mar 8, 2008
    #3
    I've got iStat Pro and agree that it's a fantastic little widget, but what I'm looking for is more something that can measure your actual runtime as opposed to projected time remaining. In other words, when my computer shuts off because the battery has run out, I want to be able to look at the program and see exactly when I unplugged the power and how long it took for the battery to completely drain. As a bonus, if it'd be able to show me what at which hour the battery drain was the fastest, that would be nice too.
     
  4. sachadon macrumors newbie

    Joined:
    Jun 28, 2009
    #5
    Invoking an year old thread. I am sure the anwers for the first questions are not satisfactory. I am looking for exactly same applications which will tell you real time battery usage. I.e. how long I was on battery power from the time I disconnected my power supply. Coconut Battery and istatpro dont give you this information.
     
  5. NikFinn macrumors 6502a

    NikFinn

    Joined:
    Jun 22, 2009
    Location:
    MA
    #6
    I feel like it would be quite simple to make a program or just a widget for the dashboard that could do that.
     
  6. eyespii thread starter macrumors 6502

    Joined:
    Mar 8, 2008
    #7
    i know i'm reviving an old thread here, but any updates on whether there's an app like this out there?
     
  7. macproguy77 macrumors newbie

    Joined:
    Mar 1, 2009
    #8
    Hey I looked for this too, googled and found this thread.
    There is nothing, so I wrote a quick and dirty shell scripts. It's very unixey, but gets the job done.

    Basically, you kick it off from a terminal when you unplug your laptop from full charge.
    The script runs, and increments a counter every minute in a file.
    When you close the lid, and the laptop is sleeping, obviously the script pauses. When you open the lid again, it resumes, and continues incrementing the counter.

    When the laptop battery goes dead, stop the script and check your counter.
    This is how many minutes you ran on battery power.

    Gotchas: You can't turn OFF the laptop while this is running, it will kill the script. You can only close the lid to sleep or hybernate.
    You can't plug it back in.. when you do it will invalidate the testing results.
    So you need to unplug, kick off the script, and not plug it back in until the battery is dead. You CAN close the lid and sleep or hybernate though.
    (I did say quick and DIRTY right..??)

    Anyway.. I'm gonna run it a few power cycles to see what the best settings for coolbook are...


    Put this in the root of your home directory with your favorite text editor and run it from your terminal window like this. Then minimize the window.

    ksh /Users/<yourid>/batterytimer.ksh

    <the above will run in your terminal windows, don't close the window>
    <Or if you wish to close the window and still have the script running in the background you can do the below>
    chmod +x /Users/<yourid>/batterytimer.ksh
    nohup /Users/<yourid>/batterytimer.ksh &

    After your battery dies, plug it back in and close the terminal window to stop the counter (if you used first option)
    Or kill the script (if you used second "nohup" option)

    To view results after you stopped the script:
    cat /tmp/batterytimer.txt
    <this gives you battery usage total time in minutes>

    ------- Begin Script
    #!/bin/ksh

    i=1

    while :
    do
    sleep 60
    echo "$i" > /tmp/batterytimer.txt
    let i=i+1
    done
     

Share This Page