in reply to time it took script to complete

Use time, not localtime. You'll calculate the difference in seconds, that way.

If you want a higher resolution than whole seconds, use

use Time::HiRes 'time';
first. It'll replace the built in time function.