Hi everyone,
Right now I'm working with streams, I have to sense something and save the result 'continuously', the trick is that every six minutes I have to stop, make a copy from the original file, re create the original file, and start again (is a block in gnuradio -just giving more info -).
I don't know how to track the 6 minutes period, any suggestion?
// Delay for x mins
// Change runtime # to increase or decrease time.
#include <iostream>
#include <windows.h>
usingnamespace std;
int m(0);
int g(0);
int runtime (6); // How many times you want the program to loop.
void countdownminutes()
{
cout << "Counting down from " << runtime << " minutes\n";
cout << " Press CTRL-C to exit\n";
while (m != runtime)
{
// This will cause a 1 min delay, spit out a msg and sleep again
Sleep (60000); // 1000ms = 1 sec 60000 = 1 min 600000 = 10 min
m = (m+1);
g = (runtime - m);
cout << g << " mins to go..." << endl;
}
cout << runtime << " min delay reached\n";
}
int main ()
{
countdownminutes();
return 0;
}