3 # $RCSfile: time.t,v $$Revision: 4.1 $$Date: 92/08/07 18:28:32 $
5 if ($does_gmtime = gmtime(time)) { print "1..6\n" }
6 else { print "1..3\n" }
8 ($beguser,$begsys) = times;
12 while (($now = time) == $beg) { sleep 1 }
14 if ($now > $beg && $now - $beg < 10){print "ok 1\n";} else {print "not ok 1\n";}
16 for ($i = 0; $i < 100000; $i++) {
17 ($nowuser, $nowsys) = times;
18 $i = 200000 if $nowuser > $beguser && ( $nowsys > $begsys ||
19 (!$nowsys && !$begsys));
20 last if time - $beg > 20;
23 if ($i >= 200000) {print "ok 2\n";} else {print "not ok 2\n";}
25 ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime($beg);
26 ($xsec,$foo) = localtime($now);
29 if ($sec != $xsec && $mday && $year)
34 exit 0 unless $does_gmtime;
36 ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = gmtime($beg);
37 ($xsec,$foo) = localtime($now);
39 if ($sec != $xsec && $mday && $year)
44 if (index(" :0:1:-1:364:365:-364:-365:",':' . ($localyday - $yday) . ':') > 0)
49 # This could be stricter.
50 if (gmtime() =~ /^(Sun|Mon|Tue|Wed|Thu|Fri|Sat) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ([ \d]\d) (\d\d):(\d\d):(\d\d) (\d\d\d\d)$/)