maybe you could use the timestamp and the help of $line

Normally the timestamp is only the first word in the line

$gettok($line(#,$line(#,0)),1,32) -> you could convert this with $ctime
then use $calc($ctime - $ctime($gettok(...))) - maybe this will help you