pht\Thread::taskCount

Gets a thread's task count

説明

public int pht\Thread::taskCount ( void )

Retrieves the current task count of a pht\Thread.

パラメータ

この関数にはパラメータはありません。

戻り値

The number of tasks remaining to be processed.

例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)