Is it possible to measure download speed using PHP tools? Desirable in kb / s. If so, I would like to understand the principle of work.

    1 answer 1

    The principle is extremely simple, and no matter what means it is done:

    1. Remember the current time ( start )
    2. Get the file
    3. Remember the current time ( stop )
    4. размер_файла / (stop - start) speed = размер_файла / (stop - start)

    For time stamping in PHP, you can use the microtime (true) function.

    PS It is clear that the smaller the file and the smaller the measurements, the greater the error will be.