File: subprocess.phpt

package info (click to toggle)
php-excimer 1.2.5-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 348 kB
  • sloc: ansic: 2,513; xml: 233; php: 82; makefile: 2
file content (24 lines) | stat: -rw-r--r-- 442 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
--TEST--
Long-running subprocess does not interfere with ExcimerTimer
--SKIPIF--
<?php if (!extension_loaded("excimer")) print "skip"; ?>
--FILE--
<?php

$timer = new ExcimerTimer();
$timer->setEventType(EXCIMER_REAL);
$timer->setInterval(5);
$timer->start();

shell_exec('sleep 10 >/dev/null 2>&1 &');

$before = microtime(true);
$timer->stop();
$after = microtime(true);

if ( ( $after - $before ) < 10 ) {
    echo 'OK';
}

--EXPECTF--
OK