Hello, Both are used and grammatical, depending on the context. The gerund form seems to be more universal. I don't like to talk to Paul, he is not a good listener.
New words, one handy idiom, and a 2-minute quiz — delivered to your inbox to keep your streak alive.
norwolf1# It’s a waste of time to talk to him.This might be slightly more likely if you are considering talking to him soon in the future.
norwolf2# It’s a waste of time talking to him.This is more likely if you are describing his usual behavior as observed on various occasions in the past.