added usleep to remove the 100%cpu, removed a insignificant printout

This commit is contained in:
Dhanya Maliakal
2017-07-26 11:36:31 +02:00
parent 0bacb903ea
commit 8a8e76e839
4 changed files with 13 additions and 11 deletions

View File

@ -58,6 +58,7 @@ void GetData(uint64_t frameNumber, uint32_t expLength, uint32_t packetNumber, ui
int main(int argc, char *argv[]) {
keeprunning = true;
bprintf(BLUE,"[ Pid: %ld ]\n", (long)getpid());
// Catch signal SIGINT to close files and call destructors properly
struct sigaction sa;
@ -137,7 +138,8 @@ int main(int argc, char *argv[]) {
FILE_LOG(logINFO) << "Ready ... ";
bprintf(GRAY, "\n[ Press \'Ctrl+c\' to exit ]\n");
while(keeprunning);
while(keeprunning)
usleep(5 * 1000 * 1000);
delete receiver;
FILE_LOG(logINFO) << "Goodbye!";