Time to Leave

When having coffee with a friend, or at a party, I typically start to leave when the conversation(s) have dried up and everyone begins to study their shoelaces. I'm not one to stick around if I'm left to myself by the fireplace, or if the conversation with a friend over coffee has left my coffee cold. If time is up, then time is up. I don't see any sense in forcing conversation in any situation. So, I'll just leave. How about you? When do you know that it is time to leave?