Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

RE: RE: Set String Length (benchmark)

by steveAZ98 (Monk)
on Jul 27, 2000 at 08:08 UTC ( [id://24628]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    use Benchmark;
    my $str = 'hello';
    ...
                'pack'      =>  q{  $str = pack("A10",$str);        },
                'sprintf'   =>  q{  $str = sprintf("%-10s",$str);   },
    });
    
  2. or download this
    Benchmark: timing 10000000 iterations of pack, sprintf...
          pack: 18 secs (16.86 usr  0.00 sys = 16.86 cpu)
       sprintf: 18 secs (17.36 usr  0.00 sys = 17.36 cpu)
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://24628]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (6)
As of 2024-04-18 14:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found