You have probably noticed that messages will pop up whenever the Sole Survivor does something to increase the companions affinity. For example if you pick a lock the message will read "Piper liked that" if she is your companion.
However, I noticed that this message does not appear all the time, there rather seems to be some kind of cooldown time intervall between messages. That is, whenever I pick two locks in short succession there will be no second message after the first.
Does that mean that affinity is unaffected by the second action? Is there some sort of cooldown phase? Or is it just the message?
The cool down does affect the relationship level. The game doesn't want you to be able to raise the relationship of a companion quickly. There was one post I found online about an experiment someone ran to test this. Here is the post. In it, he says that he tested saving and reloading between every action, and the relationship level went up between every save/action/load.
It seems that when you do actions very quickly the cool down between actions restricts you from gaining a higher relationship with your companion, but if you reload the game the cool down will be reset.