Mercurial > pub > Impl
annotate _test/temp.pl @ 424:87af445663d7 ref20150831
IMPL::Object::_Base
author | cin |
---|---|
date | Tue, 03 Apr 2018 10:54:09 +0300 |
parents | 60c2892a577c |
children | c27434cdd611 eed50c01e758 |
rev | line source |
---|---|
210 | 1 #!/usr/bin/perl |
2 use strict; | |
423 | 3 use v5.10; |
412 | 4 use Carp; |
5 use Time::HiRes qw(gettimeofday tv_interval); | |
415 | 6 use Scalar::Util qw(blessed refaddr); |
418 | 7 use YAML::XS qw(Dump Load); |
422
b0481c071bea
IMPL::Config::Container tests, YAMLConfiguration now works and tested
cin
parents:
419
diff
changeset
|
8 use Data::Dumper; |
b0481c071bea
IMPL::Config::Container tests, YAMLConfiguration now works and tested
cin
parents:
419
diff
changeset
|
9 use URI; |
418 | 10 |
424 | 11 package Bar; |
12 use base qw(IMPL::Object); | |
423 | 13 |
424 | 14 sub CTOR { |
423 | 15 } |
417 | 16 |
424 | 17 package Bar2; |
18 use base qw(Bar); | |
423 | 19 |
20 sub CTOR { | |
21 } | |
417 | 22 |
423 | 23 package Foo; |
424 | 24 use base qw(IMPL::Object::_Base); |
417 | 25 |
424 | 26 sub new { |
27 my $instance = bless {}, shift; | |
28 $instance->__construct(); | |
29 return $instance; | |
423 | 30 } |
31 | |
32 sub CTOR { | |
33 } | |
34 | |
424 | 35 package Foo2; |
36 use base qw(Foo); | |
37 | |
38 sub CTOR { | |
39 | |
40 } | |
423 | 41 |
424 | 42 package main; |
43 | |
44 my $t = [gettimeofday]; | |
45 | |
46 for(my $i=0; $i <1000000; $i++) { | |
47 my $v = new Bar2; | |
423 | 48 } |
49 | |
424 | 50 say tv_interval($t); |
422
b0481c071bea
IMPL::Config::Container tests, YAMLConfiguration now works and tested
cin
parents:
419
diff
changeset
|
51 |
407 | 52 1; |