79136131

Date: 2024-10-29 07:11:28
Score: 1.5
Natty:
Report link

Thanks to Zhenning Zhang's answer this is how I have modified my function:

In ConsoleUtils.cpp:

void fastType(const std::string& text, int delay)
{
    timeBeginPeriod(1);

    for (char c : text)
    {
        std::cout << c;
        Sleep(delay);
    }

    timeEndPeriod(1);
}

In ConsoleUtils.h:

void fastType(const std::string& text, int delay = 2);

In Main.cpp:

fastType("This is would be a paragraph of text with a delay of 2ms");

The above works perfectly for my intended use.

Reasons:
  • Blacklisted phrase (0.5): Thanks
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: Zrylx