Changeset 24504
- Timestamp:
- 11/20/08 20:23:55 (7 weeks ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
lang/perl/DateTime-Lite/trunk/tools/profile/simple_create.pl
r24501 r24504 1 1 use strict; 2 use DateTime::Lite; 2 3 my $class = $ENV{DATETIME_CLASS} || 'DateTime::Lite'; 4 5 my $before = get_memory(); 6 print "memory usage before using $class: $before\n"; 7 8 eval "require $class"; 3 9 4 10 for(1..100) { 5 DateTime::Lite->new(year => 2000, month => 1, day => 1);11 $class->new(year => 2000, month => 1, day => 1); 6 12 } 13 14 my $after = get_memory(); 15 print "memory usage after using $class: $after\n"; 16 print " memory used = ", $after - $before, "\n"; 17 18 sub get_memory { 19 my $output = `ps -opid,rss`; 20 21 foreach (split /\n/, $output) { 22 next unless /^\s(\d+)\s+(\d+)/; 23 next unless $1 eq $$; 24 25 return $2; 26 } 27 }
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)