← Index
NYTProf Performance Profile   « line view »
For /usr/local/bin/sa-learn
  Run on Tue Nov 7 05:38:10 2017
Reported on Tue Nov 7 06:16:03 2017

Filename/usr/local/lib/perl5/site_perl/Mail/SpamAssassin/Util/ScopedTimer.pm
StatementsExecuted 10 statements in 530µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
11141µs59µsMail::SpamAssassin::Util::ScopedTimer::::BEGIN@22Mail::SpamAssassin::Util::ScopedTimer::BEGIN@22
11130µs93µsMail::SpamAssassin::Util::ScopedTimer::::BEGIN@25Mail::SpamAssassin::Util::ScopedTimer::BEGIN@25
11124µs47µsMail::SpamAssassin::Util::ScopedTimer::::BEGIN@23Mail::SpamAssassin::Util::ScopedTimer::BEGIN@23
11123µs37µsMail::SpamAssassin::Util::ScopedTimer::::BEGIN@24Mail::SpamAssassin::Util::ScopedTimer::BEGIN@24
0000s0sMail::SpamAssassin::Util::ScopedTimer::::DESTROYMail::SpamAssassin::Util::ScopedTimer::DESTROY
0000s0sMail::SpamAssassin::Util::ScopedTimer::::newMail::SpamAssassin::Util::ScopedTimer::new
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1# Helper code to debug dependencies and their versions.
2
3# <@LICENSE>
4# Licensed to the Apache Software Foundation (ASF) under one or more
5# contributor license agreements. See the NOTICE file distributed with
6# this work for additional information regarding copyright ownership.
7# The ASF licenses this file to you under the Apache License, Version 2.0
8# (the "License"); you may not use this file except in compliance with
9# the License. You may obtain a copy of the License at:
10#
11# http://www.apache.org/licenses/LICENSE-2.0
12#
13# Unless required by applicable law or agreed to in writing, software
14# distributed under the License is distributed on an "AS IS" BASIS,
15# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16# See the License for the specific language governing permissions and
17# limitations under the License.
18# </@LICENSE>
19
20package Mail::SpamAssassin::Util::ScopedTimer;
21
22278µs277µs
# spent 59µs (41+18) within Mail::SpamAssassin::Util::ScopedTimer::BEGIN@22 which was called: # once (41µs+18µs) by Mail::SpamAssassin::BEGIN@80 at line 22
use strict;
# spent 59µs making 1 call to Mail::SpamAssassin::Util::ScopedTimer::BEGIN@22 # spent 18µs making 1 call to strict::import
23265µs269µs
# spent 47µs (24+22) within Mail::SpamAssassin::Util::ScopedTimer::BEGIN@23 which was called: # once (24µs+22µs) by Mail::SpamAssassin::BEGIN@80 at line 23
use warnings;
# spent 47µs making 1 call to Mail::SpamAssassin::Util::ScopedTimer::BEGIN@23 # spent 22µs making 1 call to warnings::import
24283µs252µs
# spent 37µs (23+15) within Mail::SpamAssassin::Util::ScopedTimer::BEGIN@24 which was called: # once (23µs+15µs) by Mail::SpamAssassin::BEGIN@80 at line 24
use bytes;
# spent 37µs making 1 call to Mail::SpamAssassin::Util::ScopedTimer::BEGIN@24 # spent 14µs making 1 call to bytes::import
252280µs2156µs
# spent 93µs (30+63) within Mail::SpamAssassin::Util::ScopedTimer::BEGIN@25 which was called: # once (30µs+63µs) by Mail::SpamAssassin::BEGIN@80 at line 25
use re 'taint';
# spent 93µs making 1 call to Mail::SpamAssassin::Util::ScopedTimer::BEGIN@25 # spent 63µs making 1 call to re::import
26
27114µsour @ISA = qw();
28
29sub new {
30 my $class = shift;
31 my $self = {
32 main => shift,
33 timer => shift,
34 };
35 $self->{main}->timer_start($self->{timer});
36 return bless ($self, $class);
37}
38
39# OO hack: when the object goes out of scope, the timer ends. neat!
40sub DESTROY {
41 my $self = shift;
42 # best practices: prevent potential calls to eval and to system routines
43 # in code of a DESTROY method from clobbering global variables $@ and $!
44 local($@,$!); # keep outer error handling unaffected by DESTROY
45 $self->{main} && $self->{timer} && $self->{main}->timer_end($self->{timer});
46}
47
48110µs1;