Takes a scan every x minute.
#include "davidSDK/david.h"
#include <time.h>
#include <iostream>
#include <chrono>
#include <thread>
namespace examples {
{
try
{
for (int i=0; i < scanCount; ++i)
{
time_t begin = time(0);
std::string filename;
{
tm tstruct;
#ifdef _WIN32
localtime_s(&tstruct, &begin);
#else
tstruct = *localtime(&begin);
#endif
char buf[80];
strftime(buf, sizeof(buf), "%Y-%m-%d_%H-%M-%S", &tstruct);
filename = buf;
filename += ".obj";
std::cout << "filename: " << filename << std::endl;
}
double dif = 0.0;
while (dif < waitTimeInSeconds)
{
dif = difftime(time(0), begin);
std::this_thread::sleep_for(std::chrono::milliseconds(100));
}
}
}
{
}
}
}