HOME SOFTWARE CONSULTANCY TRAINING REFERENCE PARTNERS SEARCH
spacer
Latest Tips
e-business
ITIL
Linux
Management
Modeling
Oracle
SQL
UNIX
Windows
z/OS
 
 
 
spacer
 

If you want a quick and easy way to chew up your CPU cycles, here is a Perl script that will do just that. It asks you enter a number of iterations. A sensible number of iterations to start with might be 5000. #

# COMPUTE INTENSIVE BENCHMARK
#
print "Enter required number of iterations: ";
#
# Typical number of iterations was 5000 with average elapsed time of 88 seconds
#
chomp($input_var = <STDIN>);
$start_t = time;
$blob = 0;
for ($x = 1; $x <= $input_var ; $x++) {
        for ($y = 1; $y <= $input_var; $y++) {
                $z = $x * $y;
        }
}
$end_t = time;
$tot_t = $end_t - $start_t;
print "\nStart time  : $start_t\n";
print "End time    : $end_t\n";
print "Elapsed time: $tot_t secs for $input_var iterations\n";

Next UNIX Tip