Skip to content

Commit bfcdfe1

Browse files
committed
Rename slow_print to delayed_print and flush each cout therein.
1 parent 0b7341f commit bfcdfe1

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/utils.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ void sleep(std::chrono::milliseconds ms)
1818
std::this_thread::sleep_for(ms);
1919
}
2020

21-
void slow_print(const std::string& str, std::chrono::milliseconds ms)
21+
void delayed_print(std::string_view msg, std::chrono::milliseconds ms)
2222
{
23-
for (char c : str)
23+
for (char c : msg)
2424
{
25-
std::cout << c;
25+
std::cout << c << std::flush;
2626
sleep(ms);
2727
}
2828

src/utils.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ void clear_screen();
7676

7777
void sleep(std::chrono::milliseconds ms);
7878

79-
void slow_print(const std::string& str, std::chrono::milliseconds ms);
79+
void delayed_print(std::string_view msg, std::chrono::milliseconds ms);
8080

8181
enum class Color
8282
{

0 commit comments

Comments
 (0)