ACPI administration advocacy advocacy advocacy opinion alsa amarok apache apple apt aptitude archive audio audo authentication automount avi awk backup bash BIOS boot browser business bzip cache calendar calibre cdr cdrecord censorship commandline computerscience console convert cron cut database date debian degree design desktop development disk dpkg dvd economics education emacs email europe exim faad ffmpeg file files firefox firewall flash foss freedom ftp fun fuse git gnumeric graphics grep growisofs grub gtkpod gzip hardware hardware html icedove idiocy image imagemagick images installation ip iphone ipod iptables iso itunes ivman kde kernel keyboard knoppix lame laptop latex libreoffice linux locale lockin locking longlines lsof m4a microsoft mimetypes minitab mogrify mount mp3 mp4 mplayer multimedia music mysql network nfs nfs4 nmap openbox openfiles openoffice opinion opinion orgmode partition pdf pdftk perl php podcast politics pomodoro ports postgresql print printing privacy process programming rant remote rhythmbox rss rsync rxvt scp screengrab screenshot script scripting scsi security sed server services shell siteadmin sitenews sitesoftware skype skype slackware sound sox spam spreadsheet ssh statistics subversion sudo svk swap t23 t43 tar terminal tex text thinkpad thunderbird time timer timezone ubuntu udev upgrade usb usbmount users uuid versioncontrol vfat video vnc windows wine wordpress wordprocessing X40 xwindows xwindows youtube
I searched high and low for a stopwatch that I could run on my laptop. Computers aren't the most accurate time pieces, it's true, but I didn't care. My task wasn't going to require any sort of accuracy.
Well, I couldn't find one. In fact the closest thing I found was the project management tool gnotime. This wasn't quite what I was looking for.
So, I wrote my own. The resolution is only in seconds and it's not very pretty. It suited my purpose though:
#!/bin/bash BEGIN=$(date +%s) while true; do NOW=$(date +%s) let DIFF=$(($NOW - $BEGIN)) let MINS=$(($DIFF / 60)) let SECS=$(($DIFF % 60)) echo Time elapsed: $MINS:`printf %02d $SECS` done
I made two potentially useful changes, one functional, one aesthetic:
Functional - insert: usleep 10000 ...at the top of the loop to reduces update frequency from *very* fast to once every 100th of a second (massive reduction in CPU/power use)
Aesthetic - replace the echo command with: printf "\rTime elapsed: %d:%02d" $MINS $SECS ...to avoid scrolling.
this doesent work