1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
|
--- pecl/hrtime/trunk/tests/001.phpt 2014/04/22 09:35:46 333402
+++ pecl/hrtime/trunk/tests/001.phpt 2014/04/22 11:33:51 333403
@@ -11,13 +11,11 @@
$c = new HRTime\StopWatch;
$t0 = microtime(true);
- for ($i = 0; $i < 1024; $i++);
- $t1 = microtime(true);
- $elapsed0 = $t1 - $t0;
-
$c->start();
- for ($i = 0; $i < 1024; $i++);
+ for ($i = 0; $i < (1024*1024); $i++);
+ $t1 = microtime(true);
$c->stop();
+ $elapsed0 = $t1 - $t0;
$e0 = $elapsed0;
$e1 = $c->getLastElapsedTime(HRTime\Unit::SECOND);
--- pecl/hrtime/trunk/tests/004.phpt 2014/04/22 09:35:46 333402
+++ pecl/hrtime/trunk/tests/004.phpt 2014/04/22 11:33:51 333403
@@ -11,13 +11,11 @@
$c = new HRTime\StopWatch;
$t0 = microtime(true);
- usleep(1);
- $t1 = microtime(true);
- $elapsed0 = $t1 - $t0;
-
$c->start();
usleep(1);
+ $t1 = microtime(true);
$c->stop();
+ $elapsed0 = $t1 - $t0;
$e0 = $elapsed0;
$e1 = $c->getLastElapsedTime(HRTime\Unit::SECOND);
===================================================================
--- pecl/hrtime/trunk/config.m4 (révision 333402)
+++ pecl/hrtime/trunk/config.m4 (copie de travail)
@@ -7,6 +7,7 @@
[ --enable-hrtime Enable hrtime support])
if test "$PHP_HRTIME" != "no"; then
- PHP_ADD_LIBRARY(rt)
+ PHP_ADD_LIBRARY(rt,,HRTIME_SHARED_LIBADD)
+ PHP_SUBST(HRTIME_SHARED_LIBADD)
PHP_NEW_EXTENSION(hrtime, hrtime.c timer.c, $ext_shared)
fi
===================================================================
--- pecl/hrtime/trunk/timer.h (révision 333402)
+++ pecl/hrtime/trunk/timer.h (copie de travail)
@@ -75,3 +75,8 @@
\return Current timestamp, in milliseconds */
TIMER_API tick_t timer_system( void );
+/* Compatibility stuff for php < 5.3.7*/
+#ifndef PHP_FE_END
+#define PHP_FE_END {NULL, NULL, NULL}
+#endif
+
|