Skip to content

Commit c540332

Browse files
committed
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 cfe61aa commit c540332

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
@@ -340,19 +340,23 @@ method, which returns an instance of
340340

341341
$section1->writeln('Hello');
342342
$section2->writeln('World!');
343+
sleep(1);
343344
// Output displays "Hello\nWorld!\n"
344345

345346
// overwrite() replaces all the existing section contents with the given content
346347
$section1->overwrite('Goodbye');
348+
sleep(1);
347349
// Output now displays "Goodbye\nWorld!\n"
348350

349351
// clear() deletes all the section contents...
350352
$section2->clear();
353+
sleep(1);
351354
// Output now displays "Goodbye\n"
352355

353356
// ...but you can also delete a given number of lines
354357
// (this example deletes the last two lines of the section)
355358
$section1->clear(2);
359+
sleep(1);
356360
// Output is now completely empty!
357361

358362
// setting the max height of a section will make new lines replace the old ones

0 commit comments

Comments
 (0)