How to slowprint c++ ( EASY EDITION)
WoahJamalChill (1)

hi guys, have you wondered how to slowprint in c++? well I have a super simple solution that anybody can do... it takes less than 5 min to code and you will be on your way... Good luck!

You are viewing a single comment. View All
JasonLiu19 (69)
using namespace std;
using namespace std::this_thread;
using Time = chrono::milliseconds;

ewww nooo
also this is better:

#include <iostream>
#include <chrono>
#include <thread>
#include <string>

void sp(std::string str, int delay){
  for(auto v:str){
    std::cout << v << std::flush;
    std::this_thread::sleep_for(std::chrono::milliseconds(delay));
  } 
}

It allows you to customize how many milliseconds you want.

KarterBeaver (0)

@JasonLiu19 it literally works the same

KarterBeaver (0)

@KarterBeaver and it is ver efficient... how i did it.. the time = chrono... is to make it easier

JasonLiu19 (69)

@KarterBeaver It isn't good for practical use. For small programs maybe, but for large programs it is likely you are going to get stuck in a namespace error.

KarterBeaver (0)

@JasonLiu19 well i didnt make it for huge programs... I just made it for beginners that want a easy code to slowprint

JasonLiu19 (69)

@KarterBeaver your delay is set, while people who use mine can set it to 45 or 100 or 87231797.