7 Oct 2008 ingvar   » (Master)

Maybe-useful shell oneliners #n:

(date +%s; read foo; date +%s; echo r - p) | dc

Press return to start the timer, press return again to stop it and get a rough time in seconds between the two presses. May require GNU date, as I do not know how widely spread "%s" is as time-in-seconds-since-epoch time format control.

Sadly, the first version did the subtraction and then multiplied by -1, but I think properly swapping the two top elements of the stack is a slight win for elegance (if piping things into dc can ever be called "elegance").

Latest blog entries     Older blog entries

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!