If the AF lock flag has been set at 1 (step S325), which means that the operation is a second operation after the in-focus state has been obtained, control skips to step S341 of the AF lock operation to call the sub-routine for the loop time checking operation.