update : 2015.11.03
php.shukuma.com검색:
|
EvTimer::__construct(PECL ev >= 0.2.0) EvTimer::__construct — Constructs an EvTimer watcher object 설명
public
EvTimer::__construct
(
double
$after
,
double
$repeat
,
callable
$callback
[,
mixed
$data
= NULL
[,
int
$priority
= 0
]] )Constructs an EvTimer watcher object. 인수
반환값Returns EvTimer object on success. 예제Example #1 Simple timers
<?php 위 예제의 출력 예시: 2 seconds elapsed is called every second, is launched after 2 seconds iteration = 1 is called every second, is launched after 2 seconds iteration = 2 is called every second, is launched after 2 seconds iteration = 3 is called every second, is launched after 2 seconds iteration = 4 is called every second, is launched after 2 seconds iteration = 5 Run single iteration Callback of a timer created as stopped Restart the second watcher and try to handle the same events, but don't block Running a blocking loop is called every second, is launched after 2 seconds iteration = 8 is called every second, is launched after 2 seconds iteration = 9 is called every second, is launched after 2 seconds iteration = 10 END 참고
|