In this paper, the optimization problem of harvesting for a stochastic predator-prey model with S-type distributed time delays (which contain both discrete time delays and continuously distributed time delays) is studied by using ergodic method. Sufficient and necessary conditions for the existence of optimal harvesting strategy are obtained. Moreover, the optimal harvesting effort (OHE, for short) and the maximum of expectation of sustainable yield (MESY, for short) are given. Some numerical simulations are introduced to illustrate our main results.