Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
C++ ではusleep、「メイン」パスで使用し、out前に関数を呼び出します。
usleep
out
out(); usleep(4000000);
out画面に何かを印刷するだけです。残念ながら、コマンドは sleep コマンドの前ですが、画面に表示されるのは 4 秒後です。それはどうしてですか?
PHP は、HTTP クライアントに書き込まれたデータをバッファリングしています。使用flush():
flush()
out(); flush(); usleep(4000000);