javascript
setTimeout
のメソッドに相当するものはありphp
ますか?
PHPがマルチスレッド化されていないことはわかっていますが、間違っている可能性があります。
いいえ、ありません。主な理由は、PHP はサーバー側であるため、時間指定イベントを使用してもあまり意味がありません。ただし、sleep
一定時間実行を停止する機能があります。
PHPでマルチスレッドを行うことができますpthreads
PHPマニュアルから:
pthreads is an Object Orientated API that allows user-land multi-threading in PHP.
It includes all the tools you need to create multi-threaded applications targeted at the Web or the Console.
PHP applications can create, read, write, execute and synchronize with Threads, Workers and Stackables.
参考文献
1) http://www.reddit.com/r/PHP/comments/1jo517/multithreading_in_php_with_pthreads/
JS に相当するものを取得する方法はありません。それとは何の関係もありません。異なる技術です。
何をしようとしているのかわからない。ただし、php.ini ファイルに対して max_execution_time を設定するか、スクリプト レベルでその値を上書きすることができます。
を見てみましょう
PHP にはスレッドがあるためfork
、他のマルチスレッド言語と同じように使用できます。
もちろん、いつでも独自のイベントループを作成できます;)