mirror of
https://github.com/matrix-construct/construct
synced 2024-11-11 12:31:07 +01:00
construct/console: Eliminate extra sleep() after output done.
This commit is contained in:
parent
454051f9f3
commit
bf3a23b8d2
1 changed files with 6 additions and 1 deletions
|
@ -302,7 +302,7 @@ construct::console::handle_line_bymodule()
|
||||||
// configured number of milliseconds. If these settings are too
|
// configured number of milliseconds. If these settings are too
|
||||||
// aggressive then the output heading to stdout won't appear in
|
// aggressive then the output heading to stdout won't appear in
|
||||||
// the terminal after the buffers are filled.
|
// the terminal after the buffers are filled.
|
||||||
for(size_t off(0); off < str.size(); off += size_t(ratelimit_bytes))
|
size_t off(0); if(off < str.size()) do
|
||||||
{
|
{
|
||||||
const string_view substr
|
const string_view substr
|
||||||
{
|
{
|
||||||
|
@ -310,8 +310,13 @@ construct::console::handle_line_bymodule()
|
||||||
};
|
};
|
||||||
|
|
||||||
std::cout << substr << std::flush;
|
std::cout << substr << std::flush;
|
||||||
|
off += size_t(ratelimit_bytes);
|
||||||
|
if(off >= str.size())
|
||||||
|
break;
|
||||||
|
|
||||||
ctx::sleep(milliseconds(ratelimit_sleep));
|
ctx::sleep(milliseconds(ratelimit_sleep));
|
||||||
}
|
}
|
||||||
|
while(1);
|
||||||
|
|
||||||
if(!endswith(str, '\n'))
|
if(!endswith(str, '\n'))
|
||||||
std::cout << std::endl;
|
std::cout << std::endl;
|
||||||
|
|
Loading…
Reference in a new issue