I am trying to create a function that returns a time stamp for a few seconds into the future.
Currently my attempt has been
struct timeval time;
gettimeofday(&time, NULL);
time.tv_usec += 10; // 10 seconds into the future
I will then later get a gettimeofday and do a comparison
And then do the comparison with the macro on this other stack overflow post.
To figure out when I can do the 10 seconds later code.
Is this correct? I dont fully understand the mechanics of struct timeval and like if there would be edge cases if I for example tried to increment by a sub 1 amount of seconds or perhaps an above hour amount of seconds.