gettimeofday(&start, NULL);
/* Define duration of timeout. */
delta.tv_sec = timeout / 1000;
- delta.tv_usec = timeout % 1000;
+ delta.tv_usec = (timeout % 1000) * 1000;
/* Calculate time at which we should give up. */
timeradd(&start, &delta, &end);
}
gettimeofday(&start, NULL);
/* Define duration of timeout. */
delta.tv_sec = timeout / 1000;
- delta.tv_usec = timeout % 1000;
+ delta.tv_usec = (timeout % 1000) * 1000;
/* Calculate time at which we should give up. */
timeradd(&start, &delta, &end);
}