Does "pay" mean the same thing in these two sentences?

It will pay to wait.

It pays to go through the trouble.
the same meaning