We analyze the response time of the interlocutor





With the advent of instant messengers, communication has moved to a new level - the ability to instantly access the interlocutor is now taken for granted.



But have you noticed how the speed of his response affects your communication experience? What is the generally acceptable response time?



Can we say we are being disrespectful when we reply the next day? In a week? A month later?



We will not answer these questions in this article. But without any global conclusions, we will conduct a small study of one parameter - the time of the interlocutor's response to our messages.



We get raw data



For research in our case, Telegram is best suited. First of all, because it has a convenient api for Python.



We will use the telethon library (here is its documentation ).



The code for downloading the chat history is very concise:



username = '<user>'

    user = await client.get_entity(username)

    timestamps_history = []

    offset = 0
    has_messages = True
    while has_messages:
        history = await client(GetHistoryRequest(
            peer=user,
            limit=200,
            offset_date=None,
            offset_id=0,
            max_id=0,
            min_id=0,
            add_offset=offset,
            hash=0))

        has_messages = False
        for message in history.messages:
            has_messages = True
            timestamps_history.append((message.date, message.out, message.message))

        offset += len(history.messages)
        if offset % 1000 == 0:
            print(offset)
      
      





The complete script for loading and processing messages can be seen here .



To perform it on your correspondence, when you first start, you need to log in using your phone number and security code.



Telethon returns messages in a convenient format with all the necessary parameters: we need the time of sending, the sender and the text itself.



Retrieving the response time



There are several options for values ​​that you can explore. For example, you can divide a dialogue into replicas - consecutive messages from one sender. Then the delays between our remarks and the interlocutor can be used as the studied times.



However, more indicative and interesting will be the times of answers to explicit questions - messages containing '?' at the end.



Building the distribution



So, we have the measured times of the interlocutor's answers to our questions. What to do next with this? The simplest and first thing that comes to mind is to calculate the median and average.



friend: her median: 73 my median: 38
friend: her mean: 5823.03 my mean: 3841.03

mom: her median: 15 my median: 21
mom: her mean: 352.32 my mean: 77.25

colleague: her median: 20.0 my median: 15
colleague: her mean: 815.08 my mean: 204.84

classmate: his median: 63 my median: 18
classmate: his mean: 2656.09 my mean: 554.58

ex: her median: 35 my median: 18.0
ex: her mean: 586.59 my mean: 999.27
      
      





You can see that for different people my personal meaning of reaction time differs.



But, since we want something more than two numbers, we will construct the distribution of this value:







From it, you can see the problem in the data - at long times the values ​​are quite scattered. This can be fixed. Let's try to make the time scale not linear, but logarithmic. As in life, the significance of the response time decreases logarithmically (it is quite significant whether the interlocutor answered after 5 minutes or after 10, but after a day this difference is not so significant).







Well, at the end for each person we can add a similar analysis for the times of our answers. In general, this may show how much we are more interested in communicating with the interlocutor, in comparison with him. But much more accurately you can be sure that interest in communication can be traced when comparing our reactions to different interlocutors.







You can see that we answer questions more often: the distribution of answers is shifted to 7 seconds, versus 45 for the interlocutor.



Comparison with different people



It is interesting to compare how the distribution changes depending on the relationship with the person.



Below are some examples:



Co-worker







Girl







Friend







As promised, there will be no global conclusions. Communicate the way you feel comfortable without looking back at etiquette.






All Articles