in reply to Passing a duration time from 1 subroutine to another
I don't know if I understand you correctly, but I'll take a crack.
Are you trying to get cumulative?:
in your test loop (untested)...
$self->{start} = $self->{start} || gettimeofday(): ... # at end of test my $end = gettimeofday(); $self->{duration} += ($end - $self->{start});
Then in your cleanup sub, get the data simply by using $self->{duration}.
If you need a count for each test, keep the existing code, but add at the end:
$self->{tests}{test_name} = $duration;
Then in cleanup, loop over $self->{tests} and extract the duration for each test.
You'll need to fill us in on exactly what you want for us to give a full response.
-stevieb
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Passing a duration time from 1 subroutine to another
by gasjunkie_jabz (Novice) on Aug 25, 2015 at 17:11 UTC |