modified: Makefile
[GalaxyCodeBases.git] / perl / etc / justonce / tmp / stressCPU.pl
blob30b261ac8abf0d8551e719fdc4a3c933dc92b3c0
1 #!/usr/bin/perl
2 use strict;
3 use warnings;
4 use threads;
6 my $t = shift;
8 my %thread;
9 foreach (1 .. $t) {
10 $thread{$_} = threads->new(\&test, $_);
13 my %count;
14 foreach (sort keys %thread) {
15 $count{$_} = $thread{$_}->join;
18 sub test {
19 my $in = shift;
20 my $a;
21 while ($in) {
22 ++$a;
23 --$a;