proc_nice
(PHP 5, PHP 7)
proc_nice — 現在のプロセスの優先度を変更する
説明
$increment
) : bool
proc_nice() は、現在のプロセスの優先度を
increment で指定された値に変更します。
increment が正数の場合、
現在のプロセスの優先度をより低くし、increment
が負数の場合は優先度が上がります。
proc_nice() は、proc_open() やそれに関連する関数とは関係ありません。
パラメータ
-
increment -
The new priority value, the value of this may differ on platforms.
on Unix, a low value, such as -20 means high priority wheras a positive value have a lower priority.
For Windows the
incrementparameter have the following meanings:Priority class Possible values High priority increment< -9Above normal priority increment< -4Normal priority increment< 5 &increment> -5Below normal priority increment> 5Idle priority increment> 9
返り値
成功した場合に TRUE を、失敗した場合に FALSE を返します。
ユーザーが優先度を変更する権限を持っていないなど、
エラーが発生した場合は E_WARNING
レベルのエラーも発行されます。
例
例1 Using proc_nice() to set the process priority to high
<?php
// Highest priority
proc_nice(-20);
?>
変更履歴
| バージョン | 説明 |
|---|---|
| 7.2.0 | この関数は、現在 Windows で利用可能です。 |
注意
注意: 可用性
proc_nice() は、使用しているシステムが 'nice' の機能を持っている場合のみ利用可能です。 'nice' は次のシステムに準拠しています: SVr4, SVID EXT, AT&T, X/OPEN, BSD 4.3 。
注意: Windows のみ
proc_nice() will change the current process priority, even if PHP was compiled using thread safety.