- if (now < p->lastTime+10)
- return ;
- p->lastTime = now;
- remaining = (now - p->startTime)*
- ((double) p->totalBytes/p->totalOffset - 1.0);
- if (remaining <= 130)
- logf (LOG_LOG, "Merge %2.1f%% completed; %ld seconds remaining",
- (100.0*p->totalOffset) / p->totalBytes, (long) remaining);
- else
- logf (LOG_LOG, "Merge %2.1f%% completed; %ld minutes remaining",
- (100.0*p->totalOffset) / p->totalBytes, (long) remaining/60);
+ if (now >= p->lastTime+10)
+ {
+ p->lastTime = now;
+ remaining = (now - p->startTime)*
+ ((double) p->totalBytes/p->totalOffset - 1.0);
+ if (remaining <= 130)
+ logf (LOG_LOG, "Merge %2.1f%% completed; %ld seconds remaining",
+ (100.0*p->totalOffset) / p->totalBytes, (long) remaining);
+ else
+ logf (LOG_LOG, "Merge %2.1f%% completed; %ld minutes remaining",
+ (100.0*p->totalOffset) / p->totalBytes, (long) remaining/60);
+ }
+ p->totalOffset += keyp->buf_size;