Skip to content

Commit 95ad8ec

Browse files
sungvadanOskarStark
authored andcommitted
Add sleep to observe the changes in the terminal when executing the code.
Add sleep() to observe the changes in the terminal when executing the code When I copy and execute the code in the terminal, it runs too quickly, and I don't see anything appearing on the terminal. I struggle for a moment to understand the behavior of the 'output section.'
1 parent a505d27 commit 95ad8ec

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

console.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,19 +346,23 @@ method, which returns an instance of
346346

347347
$section1->writeln('Hello');
348348
$section2->writeln('World!');
349+
sleep(1);
349350
// Output displays "Hello\nWorld!\n"
350351

351352
// overwrite() replaces all the existing section contents with the given content
352353
$section1->overwrite('Goodbye');
354+
sleep(1);
353355
// Output now displays "Goodbye\nWorld!\n"
354356

355357
// clear() deletes all the section contents...
356358
$section2->clear();
359+
sleep(1);
357360
// Output now displays "Goodbye\n"
358361

359362
// ...but you can also delete a given number of lines
360363
// (this example deletes the last two lines of the section)
361364
$section1->clear(2);
365+
sleep(1);
362366
// Output is now completely empty!
363367

364368
return Command::SUCCESS;

0 commit comments

Comments
 (0)