#!/usr/bin/perl use strict; use warnings; my $first = 39703 * 86400 + 4 * 3600; my $second = 39652 * 86400; my $diff = 25; my $rate = ($first - $second) / $diff; my $estimated_duration = int($first / $rate); my $estimated_finish_time = scalar localtime(time + $estimated_duration); print "Estimated duration: $estimated_duration seconds\n"; print "Estimated finish time: $estimated_finish_time (if we start now)\n";