#!/usr/bin/perl use strict; use warnings; use POSIX qw(strftime); my $start = time(); sleep 10; my $end = time(); my $duration = $end - $start; print "It took me $duration seconds\n"; my $start_date = strftime "%Y-%m-%d %H:%M:%S", localtime($start); my $end_date = strftime "%Y-%m-%d %H:%M:%S", localtime($end); print "I was started on $start_date and ended on $end_date\n";