o
    -˜Žj¼  ã                   @   s2   d dl m Z  d dlZd dlmZ G dd„ dƒZdS )é    )ÚtimeN)Úrawc                   @   s   e Zd Zddd„ZdS )ÚPingÚselfúpyrogram.Clientc                 Ã   s<   �t ƒ }|  tjjj|  ¡ d�¡I dH  tt ƒ | d dƒS )aÿ  Measure the round-trip time (RTT) to the Telegram server.

        The ping method sends a request to the Telegram server and measures the time it takes to receive a response.
        This can be useful for monitoring network latency and ensuring a stable connection to the server.

        Returns:
            float: The round-trip time in milliseconds (ms).

        Example:
            .. code-block:: python

                latency = await app.ping()
                print(f"Ping: {latency} ms")
        )Úping_idNg     @�@é   )r   Úinvoker   Ú	functionsÚpingr   Úrnd_idÚround)r   Ú
start_time© r   ú\/var/www/kodo/Anonymous/send/lib/python3.10/site-packages/pyrogram/methods/utilities/ping.pyr      s   €
ÿz	Ping.pingN)r   r   )Ú__name__Ú
__module__Ú__qualname__r   r   r   r   r   r      s    r   )r   Úpyrogramr   r   r   r   r   r   Ú<module>   s   