Loading data thread function definition
| 128 | |
| 129 | // Loading data thread function definition |
| 130 | static void LoadDataThread() |
| 131 | { |
| 132 | using namespace std::chrono; |
| 133 | int timeCounter = 0; // Time counted in ms |
| 134 | |
| 135 | auto prevTime = steady_clock::now(); |
| 136 | |
| 137 | // We simulate data loading with a time counter for 5 seconds |
| 138 | while (timeCounter < 5000) |
| 139 | { |
| 140 | auto currentTime = steady_clock::now() - prevTime; |
| 141 | timeCounter = duration_cast<milliseconds>(currentTime).count(); |
| 142 | |
| 143 | // We accumulate time over a global variable to be used in |
| 144 | // main thread as a progress bar |
| 145 | dataProgress = timeCounter/10; |
| 146 | } |
| 147 | |
| 148 | // When data has finished loading, we set global variable |
| 149 | dataLoaded = true; |
| 150 | } |
nothing calls this directly
no outgoing calls
no test coverage detected