SummaryDistributed gossip algorithm has been studied for practical implementation of fundamental algorithms employed for collaborative processing. This paper focuses on optimizing the convergence rate of the gossip algorithm for both classical and quantum networks. By modifying the rate of the Poisson process, a new model of the gossip algorithm with nonuniform clock distribution is proposed which can reach the optimal convergence rate of the continuous‐time consensus algorithm. For quantum gossip algorithm, the evolution equation of the quantum gossip algorithm is transformed to the state update equation of the classical gossip algorithm. Defining the quantum gossip operator, the original optimization problem is formulated as a convex optimization problem, where the analytical answer is provided for a series of topologies. It is shown that the optimal results obtained for uniform clock distribution are suboptimal compared to those of the nonuniform one and for nonuniform distribution the optimal answer is not unique. Based on the optimal continuous‐time consensus algorithm and the detailed balance property, an effective method of obtaining one of these optimal answers is proposed.