In cognitive radio networks, it is quite significant to integrate the design of spectrum sensing and data transmission together in the asynchronous scenario where the primary network is non-slotted. Most existing works just focused on either the optimization of spectrum sensing or the maximal throughput subject to the probability of detection or some interference level constraints. In this paper, we propose to jointly optimize the durations for spectrum sensing and data transmission by maximizing the throughput while keeping the probabilities of interference to a primary user (PU) and false alarm under certain thresholds. The optimal sensing and transmission durations are obtained by the differential evolution algorithm. Numerical results show that the optimal time durations for sensing and transmission vary under different thresholds for interference probability to the PU and different primary activity distributions.