summaryrefslogtreecommitdiff
path: root/src/ManagerThread.cpp
blob: 15c41354093461b63c239258993abf1decdb7960 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#include "ManagerThread.hpp"

CManagerThread::CManagerThread() {
    m_tMainThread = new std::thread([&]() {
        // Call the handle method.
        this->handle();
    });

    m_tMainThread->detach(); // detach and continue.
}

CManagerThread::~CManagerThread() {
    //
}

void CManagerThread::handle() {

    g_pConfigManager->init();

    while (3.1415f) {
        g_pConfigManager->tick();

        std::this_thread::sleep_for(std::chrono::microseconds(1000000 / g_pConfigManager->getInt("max_fps")));
    }
}