time diff help

Input file: 

Tue Oct 21 12:56:35 2008 Started
Tue Oct 21 12:56:39 2008 Completed
Tue Oct 21 12:57:25 2008 Started
Tue Oct 21 12:57:32 2008 Completed
Tue Oct 21 12:58:12 2008 Started
Tue Oct 21 12:58:50 2008 Completed

Output required:

Tue Oct 21 12:56:35 2008 Started
Tue Oct 21 12:56:39 2008 Completed
Total=4 secs
Tue Oct 21 12:57:25 2008 Started
Tue Oct 21 12:58:32 2008 Completed
Total=67 secs
Tue Oct 21 12:58:12 2008 Started
Tue Oct 21 12:58:50 2008 Completed
Total=38 secs


I tried something like this:

awk -v secs=$((`date +%s -d"Tue Oct 21 12:56:39 2008"` - `date +%s -d"Tue Oct 21 12:56:35 2008"`)) '{print secs}'

I want to calculate the time diff using gnu date; Please help

Try this script.

#!/bin/sh
if [ $# -ne 1 ];then
        echo Usage: script file; exit 1;fi
while read line
do
 case ${line##* } in
  Started)      start=$(date +%s -d "${line% *}")
                echo "$line";;
  Completed)    end=$(date +%s -d "${line% *}")
                echo "$line"
                echo "Total=$(($end - $start)) sec";;
 esac
done < $1

Danmero, thanks a lot.