put "now" just before call to qstat -f. "now" was originally computed much later in the code, probably why the "last start" time was never less than 5 seconds ... 5 seconds worth of parsing, db inserts etc before now was computed!