Is it possible to get information on download and upload speed using standard PHP tools (ssh2_sftp)?
Asked
Active
Viewed 103 times
0
-
2https://stackoverflow.com/a/18690550/1597430 – user1597430 Nov 27 '20 at 07:19
1 Answers
1
$start = time();
$sftp->get('filename', 'local/filename'); //gets the file
$size = $sftp->size('filename'); //gives the size of the file.
$timeTakenInSeconds = time() - $start;
echo sprintf('Bytes/second: %d', $size / $timeTakenInSeconds);

Dima Kuzmin
- 161
- 1
- 2
- 10