Cynosure.X International LLC

: :

Add Comment | Related Links | TrackBack
Related Content

BatteryTimer.sh (GPL)

Recently my friend has received the OLPC laptop, the XO. This laptop can run for more than 3 hours on battery power, in theory. There is a black-and-white display mode that is suppose to save a lot of battery power. But controversy exists that claims the battery life didn't change in black-and-white mode.

So I decided to write this battery timer to determine how long the battery life is exactly. This will not only help us determine how long the battery lasts in color and black-and-white mode on the XO, but will also help you determine battery life on your new and older notebook computers.

This script will run on any UNIX-based operating system, such as Linux, Mac OS, or the Sugar OS on the OLPC. To use it, charge the battery all the way up, unplug the notebook from the wall AC adapter, execute the BatteryTimer.sh script that is attached to this thread, and wait till the notebook dies. After the notebook dies, boot it up again. BatteryTimer.sh will create a log file called "BatteryTimer.txt" in the directory where you executed BatteryTimer.sh. This log file contains the time stamp at the start and end of execution. Use this command to see the battery life: "cat BatteryTimer.txt"

For a controlled comparison between two or more computing modes (such as color vs. black-and-white on the OLPC), you should not use the computer while the BatteryTimer.sh is running. On the other hand, if you want to measure how long the battery lasts during your day-to-day routine, you can start this script while you are using your notebook computer.

BatteryTimer.sh is distributed as executable source code under the GNU General Public License. Please see the license agreement elsewhere on this site.

Attached File: BatteryTimer.sh (322 B)

Chieh Cheng
Tue, 12 Feb 2008 00:38:52 +0000

Today, I needed this BatteryTimer.sh utility to test how long my MSi Wind U100 lasts on an external battery source, with an DC/AC power converter. I found that this utility loops unnecessary number of times. The UNIX date utility is only precise own to one second. There is no need to time stamp more than once per second, which creates an unnecessary large time stamp file. Therefore, I have modified it slightly to only records time once per second, dramatically reducing the output file size.

One beauty of BatteryTimer.sh is that it does not put an artificial load on your system, allowing you to measure battery time with any kind of load you like to introduce into your system. You can mix and match various CPU load, disk I/O load, and external connection load at will.

Attached File: 1 - BatteryTimer.sh (331 B)

Chieh Cheng
Sun, 11 Jan 2009 23:05:14 +0000

Add Comment | Related Links | TrackBack
Related Content

Did your message disappear? Read the Forums FAQ.

Add Comment

Spam Control | * indicates required field
Your Name: *
E-mail:
Remember Me!
Comment: *
File attachment is optional. Please do not attach a file to your submission unless it is relevent.
Attach File:
(20 MB Max)
Spam Protection: * Answer of 6 + 9?
Click button only once, please!

TrackBack

TrackBack only accepted from WebSite-X Suite web sites. Do not submit TrackBacks from other sites.

Send Ping | TrackBack URL | Spam Control

No TrackBacks yet. TrackBack can be used to link this thread to your weblog, or link your weblog to this thread. In addition, TrackBack can be used as a form of remote commenting. Rather than posting the comment directly on this thread, you can posts it on your own weblog. Then have your weblog sends a TrackBack ping to the TrackBack URL, so that your post would show up here.

Messages, files, and images copyright by respective owners.

Products | Services
Forums | Latest | RSS
Library | Search | Wiki
Help | Licenses

Login | Register

32 Users Online

Hacking Digital Cameras
Fun for Photographers



Amazon Associate

Copyright © 1996 - 2024. All Rights Reserved.