counter with timeout