13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
* LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
* file.
*/
#include "config.h"
#include <math.h>
#ifdef HAVE_SYS_IOCTL_H
# include <sys/ioctl.h>
#endif
#import "OFDate.h"
#import "OFStdIOStream.h"
#import "OFTimer.h"
#import "ProgressBar.h"
|
>
>
>
>
>
|
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
* LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
* file.
*/
#include "config.h"
#include <math.h>
#include <unistd.h>
#ifdef HAVE_SYS_IOCTL_H
# include <sys/ioctl.h>
#endif
#ifdef HAVE_SYS_TERMIOS_H
# include <sys/termios.h>
#endif
#import "OFDate.h"
#import "OFStdIOStream.h"
#import "OFTimer.h"
#import "ProgressBar.h"
|
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
|
[self _drawReceived];
}
- (void)calculateBPSAndETA
{
_BPS = (float)(_received - _lastReceived) /
-(float)[_lastReceivedDate timeIntervalSinceNow];
_ETA = (double)(_length - _resumedFrom - _received) / _BPS;
_lastReceived = _received;
[_lastReceivedDate release];
_lastReceivedDate = [[OFDate alloc] init];
}
- (void)stop
|
|
|
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
|
[self _drawReceived];
}
- (void)calculateBPSAndETA
{
_BPS = (float)(_received - _lastReceived) /
-(float)[_lastReceivedDate timeIntervalSinceNow];
_ETA = (double)(_length - _received) / _BPS;
_lastReceived = _received;
[_lastReceivedDate release];
_lastReceivedDate = [[OFDate alloc] init];
}
- (void)stop
|