Cycle length finder