Commit | Line | Data |
8d063cd8 |
1 | #!./perl |
2 | |
135863df |
3 | # $Header: op.time,v 1.0.1.1 88/01/24 03:56:09 root Exp $ |
8d063cd8 |
4 | |
5 | print "1..5\n"; |
6 | |
7 | ($beguser,$begsys) = times; |
8 | |
9 | $beg = time; |
10 | |
11 | while (($now = time) == $beg) {} |
12 | |
13 | if ($now > $beg && $now - $beg < 10){print "ok 1\n";} else {print "not ok 1\n";} |
14 | |
15 | for ($i = 0; $i < 100000; $i++) { |
16 | ($nowuser, $nowsys) = times; |
17 | $i = 200000 if $nowuser > $beguser && $nowsys > $begsys; |
18 | last if time - $beg > 20; |
19 | } |
20 | |
21 | if ($i >= 200000) {print "ok 2\n";} else {print "not ok 2\n";} |
22 | |
23 | ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime($beg); |
24 | ($xsec,$foo) = localtime($now); |
25 | $localyday = $yday; |
26 | |
135863df |
27 | if ($sec != $xsec && $mday && $year) |
8d063cd8 |
28 | {print "ok 3\n";} |
29 | else |
30 | {print "not ok 3\n";} |
31 | |
32 | ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = gmtime($beg); |
33 | ($xsec,$foo) = localtime($now); |
34 | |
135863df |
35 | if ($sec != $xsec && $mday && $year) |
8d063cd8 |
36 | {print "ok 4\n";} |
37 | else |
38 | {print "not ok 4\n";} |
39 | |
40 | if (index(" :0:1:-1:365:366:-365:-366:",':' . ($localyday - $yday) . ':') > 0) |
41 | {print "ok 5\n";} |
42 | else |
43 | {print "not ok 5\n";} |