Counter class rewritten without sleep.