Skip to content

Commit 441aa56

Browse files
authored
Merge pull request #25 from eserte/faster-fork-t
faster fork.t
2 parents 68eddb6 + e972d38 commit 441aa56

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

t/fork.t

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,7 @@ for my $i (1 .. $children) {
4242
} else {
4343
# in a child we can't keep the count properly so we do it manually
4444
# make sure that child 1 dies first
45-
srand();
46-
my $time = (($i-1) * 5) +int(rand(5));
45+
my $time = ($i-1) * 3;
4746
print "# child $i sleeping for $time seconds\n";
4847
sleep($time);
4948
my $count = $i + 1;
@@ -76,8 +75,7 @@ for my $i (1 .. $children) {
7675
# parent process
7776
next;
7877
} else {
79-
srand();
80-
my $time = (($i-1) * 5) +int(rand(5));
78+
my $time = ($i-1) * 3;
8179
print "# child $i sleeping for $time seconds\n";
8280
sleep($time);
8381
my $count = 5 + $i;

0 commit comments

Comments
 (0)