-## profiling-related data/functions
-our ($Prof_utime0, $Prof_stime0);
-sub _pre_profile {
- ($Prof_utime0, $Prof_stime0) = getrusage();
-}
-
-sub _post_profile {
- # get post information
- my ($autime, $astime) = getrusage();
-
- # calculate differences
- my $utime = $autime - $Prof_utime0;
- my $stime = $astime - $Prof_stime0;
-
- foreach my $k (@_) {
- $Profiling{$k} ||= [ 0.0, 0.0, 0 ];
- $Profiling{$k}->[0] += $utime;
- $Profiling{$k}->[1] += $stime;
- $Profiling{$k}->[2]++;
- }
-}
-