Skip to content

Commit

Permalink
countUpTo
Browse files Browse the repository at this point in the history
  • Loading branch information
FLAK-ZOSO committed Feb 8, 2022
1 parent e7e8e43 commit f0b4433
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
5 changes: 1 addition & 4 deletions cleanScreen.cpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
#include <iostream>
#include "cleanScreen.hpp"


int main() {
std::cout << "Hello, ";
cleanScreen();
std::cout << "World!";
countUpTo(1000);
}
Binary file modified cleanScreen.exe
Binary file not shown.
12 changes: 12 additions & 0 deletions cleanScreen.hpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,19 @@
#include <iostream>
#include <stdlib.h>
#include <chrono>
#include <thread>


void cleanScreen() {
system("cls");
}


void countUpTo(int n) {
std::chrono::milliseconds timespan(7);
for (int i = 0; i < n; i++) {
cleanScreen();
std::cout << i;
std::this_thread::sleep_for(timespan);
}
}

0 comments on commit f0b4433

Please sign in to comment.