He had a time holding back the tears.
They had a good time together.
Does the word "time" mean the same thing in the above two sentences?
the same meaning