Learn to Code via Tutorials on Repl.it!

← Back to all posts
How to slowprint c++ ( EASY EDITION)
WoahJamalChill (3)

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!

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;

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.