a7c1536569f07d68e092abfde3bf2cfdae3308aa
[m6w6/ext-psi] / tests / time / time003.phpt
1 --TEST--
2 nanosleep
3 --SKIPIF--
4 <?php
5 extension_loaded("psi") or die("skip - need ext/psi");
6 ?>
7 --ENV--
8 TZ=UTC
9 --INI--
10 psi.directory = {PWD}/../../psis:{PWD}
11 --FILE--
12 ===TEST===
13 <?php
14 var_dump(psi\gettimeofday($tv1), $tv1);
15 var_dump(psi\nanosleep(["tv_nsec" => 10000000], $rm), $rm);
16 var_dump(psi\gettimeofday($tv2), $tv2);
17 var_dump($tv2["tv_usec"]-$tv1["tv_usec"]);
18 ?>
19 ===DONE===
20 --EXPECTF--
21 ===TEST===
22 int(0)
23 array(2) {
24 ["tv_sec"]=>
25 int(1%d)
26 ["tv_usec"]=>
27 int(%d)
28 }
29 int(0)
30 array(2) {
31 ["tv_sec"]=>
32 int(0)
33 ["tv_nsec"]=>
34 int(0)
35 }
36 int(0)
37 array(2) {
38 ["tv_sec"]=>
39 int(%d)
40 ["tv_usec"]=>
41 int(%d)
42 }
43 int(%r\d\d\d\d\d%r)
44 ===DONE===