mirror of
https://github.com/mirror/wget.git
synced 2025-03-25 01:00:13 +08:00
* src/retr.c (calc_rate): Add TB/s
This commit is contained in:
parent
0179138fe5
commit
1c1cba3a43
14
src/retr.c
14
src/retr.c
@ -809,11 +809,12 @@ double
|
||||
calc_rate (wgint bytes, double secs, int *units)
|
||||
{
|
||||
double dlrate;
|
||||
double bibyte = 1000.0;
|
||||
double bibyte;
|
||||
|
||||
if (!opt.report_bps)
|
||||
bibyte = 1024.0;
|
||||
|
||||
else
|
||||
bibyte = 1000.0;
|
||||
|
||||
assert (secs >= 0);
|
||||
assert (bytes >= 0);
|
||||
@ -832,10 +833,13 @@ calc_rate (wgint bytes, double secs, int *units)
|
||||
*units = 1, dlrate /= bibyte;
|
||||
else if (dlrate < (bibyte * bibyte * bibyte))
|
||||
*units = 2, dlrate /= (bibyte * bibyte);
|
||||
|
||||
else
|
||||
/* Maybe someone will need this, one day. */
|
||||
else if (dlrate < (bibyte * bibyte * bibyte * bibyte))
|
||||
*units = 3, dlrate /= (bibyte * bibyte * bibyte);
|
||||
else {
|
||||
*units = 4, dlrate /= (bibyte * bibyte * bibyte * bibyte);
|
||||
if (dlrate > 99.99)
|
||||
dlrate = 99.99; // upper limit 99.99TB/s
|
||||
}
|
||||
|
||||
return dlrate;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user