Time measurement added. Sum > 9 * N check added.