Add speed and time to progress callbacks
This commit is contained in:
parent
0596231704
commit
203d86cb28
2
docs
2
docs
@ -1 +1 @@
|
|||||||
Subproject commit 087d105504aedc9eda89660f8cbc3842f116f573
|
Subproject commit 135f3110232f3a486b83438fdc0f15db165f7494
|
@ -277,10 +277,12 @@ trait Files
|
|||||||
$ctx = \hash_init('md5');
|
$ctx = \hash_init('md5');
|
||||||
$promises = [];
|
$promises = [];
|
||||||
|
|
||||||
$cb = function () use ($cb, $part_total_num) {
|
$speed = 0;
|
||||||
|
$time = 0;
|
||||||
|
$cb = function () use ($cb, $part_total_num, &$speed, &$time) {
|
||||||
static $cur = 0;
|
static $cur = 0;
|
||||||
$cur++;
|
$cur++;
|
||||||
\danog\MadelineProto\Tools::callFork($cb($cur * 100 / $part_total_num));
|
\danog\MadelineProto\Tools::callFork($cb($cur * 100 / $part_total_num, $speed, $time));
|
||||||
};
|
};
|
||||||
|
|
||||||
$start = \microtime(true);
|
$start = \microtime(true);
|
||||||
@ -1155,10 +1157,12 @@ trait Files
|
|||||||
}
|
}
|
||||||
$count = \count($params);
|
$count = \count($params);
|
||||||
|
|
||||||
$cb = function () use ($cb, $count) {
|
$time = 0;
|
||||||
|
$speed = 0;
|
||||||
|
$cb = function () use ($cb, $count, &$time, &$speed) {
|
||||||
static $cur = 0;
|
static $cur = 0;
|
||||||
$cur++;
|
$cur++;
|
||||||
\danog\MadelineProto\Tools::callFork($cb($cur * 100 / $count));
|
\danog\MadelineProto\Tools::callFork($cb($cur * 100 / $count, $time, $speed));
|
||||||
};
|
};
|
||||||
|
|
||||||
$cdn = false;
|
$cdn = false;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user