$self->{start} = $self->{start} || gettimeofday(): ... # at end of test my $end = gettimeofday(); $self->{duration} += ($end - $self->{start});