#!/usr/bin/perl use strict; use Time::HiRes qw (usleep time gettimeofday); use CGI qw/:standard *table start_ul use_named_parameters/; # load standard CGI routines use CGI::Carp qw /fatalsToBrowser/; print "Content-Type:text/html\r\n\r\n"; print "\n"; print "\n"; print "\n"; print "
\n"; my $sleep = 100; my $t1 = time; print "using sleep of $sleep
\n"; print "start time $t1
\n"; # this was taken from the 2004 example vvvvvvvvvvvvvv my $pid = fork; die "Error forking: $!" unless defined $pid; if (!$pid) { my $pid = fork; die "Error forking: $!" unless defined $pid; if (!$pid) { exec("sleep $sleep &"); # << except for this, changed from "foo" } else { CORE::exit; } } # ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ my $t2 = time; my $tdiff = $t2 - $t1; print "end time $t2
\n"; print "difference = $tdiff
\n"; print "
\n"; print "\n";