Help for this page

Select Code to Download


  1. or download this
    #!/usr/bin/env perl
    
    ...
    print scalar(@array1), " elements. Last element value is $array1[-1]\n
    +";
    printf "Array size is %-0.2f megabytes\n", size(\@array1)/1024/1024;
    printf "Without preallocation: %-0.4f seconds\n", $t1_delta;
    
  2. or download this
    Testing preallocation.
    5000000 elements. Last element value is 4999999
    ...
    5000000 elements. Last element value is 4999999
    Array size is 44.55 megabytes
    Without preallocation: 0.2775 seconds
    
  3. or download this
                    
    # spent 1.30s (1.30+49µs) within main::main which was called:
    ...
    32                    
    33    1    7µs    1    1.30s    main();
    # spent  1.30s making 1 call to main::main