} /* }}} int compare_time */
static int get_boundet_random(int min, int max) /* {{{ */
} /* }}} int compare_time */
static int get_boundet_random(int min, int max) /* {{{ */
vl = calloc(1, sizeof(*vl));
if (vl == NULL) {
fprintf(stderr, "calloc failed.\n");
vl = calloc(1, sizeof(*vl));
if (vl == NULL) {
fprintf(stderr, "calloc failed.\n");
}
vl->values = calloc(/* nmemb = */ 1, sizeof(*vl->values));
if (vl->values == NULL) {
fprintf(stderr, "calloc failed.\n");
free(vl);
}
vl->values = calloc(/* nmemb = */ 1, sizeof(*vl->values));
if (vl->values == NULL) {
fprintf(stderr, "calloc failed.\n");
free(vl);
} /* }}} int send_value */
static int get_integer_opt(const char *str, int *ret_value) /* {{{ */
} /* }}} int send_value */
static int get_integer_opt(const char *str, int *ret_value) /* {{{ */
} /* }}} int get_integer_opt */
static int get_double_opt(const char *str, double *ret_value) /* {{{ */
} /* }}} int get_integer_opt */
static int get_double_opt(const char *str, double *ret_value) /* {{{ */
} /* }}} int get_double_opt */
static int read_options(int argc, char **argv) /* {{{ */
} /* }}} int get_double_opt */
static int read_options(int argc, char **argv) /* {{{ */
} /* }}} int read_options */
int main(int argc, char **argv) /* {{{ */
} /* }}} int read_options */
int main(int argc, char **argv) /* {{{ */
- /* 1 / 100 second */
- struct timespec ts = {0, 10000000};
-
- ts.tv_sec = (time_t)now;
- ts.tv_nsec = (long)((now - ((double)ts.tv_sec)) * 1e9);
+ double diff = vl->time - now;
+ struct timespec ts = {
+ .tv_sec = (time_t)diff,
+ };
+ ts.tv_nsec = (long)((diff - ((double)ts.tv_sec)) * 1e9);