A new mechanism to achieve optical delay is proposed. A compound waveguide with unidirectional boundary loop and unidirectional air waveguide is constructed. When the electromagnetic wave propagates through the boundary loop, its one-way transmission and the constructive interference effect make the electromagnetic wave around these loops to achieve the perfect transmission. These loops lead to optical delay because of the enlarged propagation distance. The unique feature of the composite waveguide is that it has compound functions, such as optical delay, one-way transmission and overcoming scattering loss. The frequency-domain and time-domain simulation demonstrates the perfect transmission and time delay function, respectively.