The recurrence time for ergodic systems with infinite invariant measures