Took into respect time granularity with stdio speed control
This commit is contained in:
parent
1786e8008f
commit
eb88f800d7
@ -1 +1 @@
|
|||||||
#define Cdrskin_timestamP "2007.09.12.200106"
|
#define Cdrskin_timestamP "2007.09.14.122437"
|
||||||
|
@ -1799,7 +1799,8 @@ int burn_stdio_slowdown(struct burn_drive *d, struct timeval *prev_time,
|
|||||||
gettimeofday(&tnow, &dummy_tz);
|
gettimeofday(&tnow, &dummy_tz);
|
||||||
to_wait = ( ((double) amount) / (double) d->nominal_write_speed ) -
|
to_wait = ( ((double) amount) / (double) d->nominal_write_speed ) -
|
||||||
(double) ( tnow.tv_sec - prev_time->tv_sec ) -
|
(double) ( tnow.tv_sec - prev_time->tv_sec ) -
|
||||||
(double) ( tnow.tv_usec - prev_time->tv_usec ) / 1.0e6;
|
(double) ( tnow.tv_usec - prev_time->tv_usec ) / 1.0e6
|
||||||
|
- 0.001; /* best would be 1 / kernel granularity HZ */
|
||||||
if (to_wait >= 0.0001) {
|
if (to_wait >= 0.0001) {
|
||||||
usleep((int) (to_wait * 1000000.0));
|
usleep((int) (to_wait * 1000000.0));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user