in reply to Finding out how long a script has been running

I suggest to look up perlman:perlvar of which I here cite:

$BASETIME

$^T

The time at which the program began running, in seconds since the epoch (beginning of 1970). The values returned by the -M, -A, and -C filetests are based on this value.

So you might be looking for something alike this

my $runTimeInSecs = time() - $^T;


Have a nice day
All decision is left to your taste