use Time::Piece;
use Date::Calc qw(Delta_DHMS);
my $start = localtime;
sleep 3;
my $end = localtime;
my $diff = $end - $start;
# my $diff = $start - $end;
print $diff,"\n";
my @df =Delta_DHMS($start->year,$start->mon,$start->mday,$start->hour,$start->min,$start->sec,
$end->year,$end->mon,$end->mday,$end->hour,$end->min,$end->sec);
$" = ',';# カンマ区切りで出力
print "@df\n";
No comments:
Post a Comment