略微加速

PHP官方手册 - 互联网笔记

PHP - Manual: pht\Thread::taskCount

2024-12-26

pht\Thread::taskCount

(PECL pht >= 0.0.1)

pht\Thread::taskCountGets a thread's task count

说明

public pht\Thread::taskCount ( void ) : int

Retrieves the current task count of a pht\Thread.

参数

此函数没有参数。

返回值

The number of tasks remaining to be processed.

范例

Example #1 Getting the task count of a thread

<?php

use pht\Thread;

$thread = new Thread();

$thread->addFunctionTask(function (){});
$thread->addFunctionTask(function (){});
$thread->addFunctionTask(function (){});

var_dump($thread->taskCount());

以上例程会输出:

int(3)
add a note add a note

User Contributed Notes

There are no user contributed notes for this page.

官方地址:https://www.php.net/manual/en/pht-thread.taskCount.php

北京半月雨文化科技有限公司.版权所有 京ICP备12026184号-3