Skip to content

Commit

Permalink
feat(core): add sleep timeout before starting sending information
Browse files Browse the repository at this point in the history
  • Loading branch information
y4cer committed Jul 23, 2023
1 parent 0c25a88 commit 531857e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
#include "grpc/key_value_service_client.h"
#include "snmp/SNMP_client.h"

const int START_INTERVAL = 10000;

void timer_start(std::function<void(void)> func, unsigned int interval) {
std::thread([func, interval]() {
while (true) {
Expand Down Expand Up @@ -60,6 +62,7 @@ int main(int argc, char** argv) {
std::string ip = argv[3];
std::string grpc_server_addr = argv[4];

std::this_thread::sleep_for(std::chrono::milliseconds(START_INTERVAL));
driver_generate(rps, ip, grpc_server_addr, sensor_id);

return 0;
Expand Down

0 comments on commit 531857e

Please sign in to comment.