Ergodic versus diffusive decoherence in mesoscopic devices