Hi,
I have start and end time like this:
$start = "Wed Apr 27 03:57:21 EDT 2011"
$end = "Wed Apr 27 03:58:42 EDT 2011"
I need to compute the exact time taken some thing like 2 hours or 1 min.
I have to do this with out using Perl Modules.
I tried like this:
$start = gettime;
#some piece of code....
$end = gettime;
$diff = $start - $end;
print "\n diff --- $diff \n";
sub gettime
{
my ($sec,$min,$hour,$mday,$mon,$year)=localtime(time);
$mon++;
$year+=1900;
return "$mday/$mon/$year $hour:$min:$sec";
}
How can i get the difference between start time and end time?
For example:
50 secs
10 mins
How can i get the above time with out any perl modules in perl?
Any ideas?
Regards
amith