A switching strategy is proposed for the bandit problem with infinitely many arms. An arm is played as long as the value of some statistic computed from this arm sample mean and variance does not exceed a certain threshold; then a new arm is tried. Optimality features of the strategy are discussed under assumptions on the prior distribution of the mean reward, and a heuristics is suggested in the situation with unspecified prior.