in reply to Does it Iactually/I run faster?
use Benchmark; @array = ('elementary school', 'blah blah blah', 'stuff', 'hello', 'ya +y'); timethese(100000, { 'one line' => '&one_line', 'multi line' => '&multi_line'}); sub one_line { do {s/\s+/\t/; s/elementary/my dear Watson/g;} for @array; } sub multi_line { for ( @array ) { s/\s+/\t/; s/elementary/my dear Watson/g; } }
|
---|
Replies are listed 'Best First'. | |
---|---|
RE: Re: Does it Iactually/I run faster?
by vkonovalov (Monk) on Jul 04, 2000 at 19:27 UTC | |
by maverick (Curate) on Jul 04, 2000 at 21:03 UTC | |
by eduardo (Curate) on Jul 04, 2000 at 20:24 UTC | |
RE: Re: Does it Iactually/I run faster?
by greenhorn (Sexton) on Jul 06, 2000 at 01:25 UTC |