in reply to Re: Re: is 'my' that much faster than 'local'?
in thread is 'my' that much faster than 'local'?
outputsuse Time::HiRes qw(gettimeofday); $start_time = gettimeofday(); $global_variable = "hello!"; for ($i = 0; $i < 10000000; $i++) { # replace this with "my" local $global_variable = "redefined. . "; } print gettimeofday - $start_time." seconds\n"; print "$global_variable\n";
and31.4016380310059 seconds hello!
when using "my" instead.14.1771370172501 seconds hello!
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: is 'my' that much faster than 'local'?
by sierrathedog04 (Hermit) on Mar 27, 2001 at 03:05 UTC | |
by Dominus (Parson) on Mar 27, 2001 at 21:32 UTC |