summaryrefslogtreecommitdiffstats
path: root/lab1/lib/lifeutil.cpp
blob: 204ed6d81b767e8d011a40849e0301f56072bb70 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include <cstdlib>
#include <chrono>
#include <thread>
#include "lifeutil.h"

void clearConsole()
{
#if defined(_WIN32) || defined (_WIN64)
        std::system("CLS");
#else
        // assume POSIX
        std::system("clear");
#endif
}


void pause(int ms)
{
    if (ms > 0)
    {
        std::this_thread::sleep_for(std::chrono::milliseconds(ms));
    }
}