All-optical clock recovery for the return-to-zero modulation format is demonstrated experimentally at 40 Gbits/s by using an amplified feedback laser. A 40 GHz optical clock with a root-mean-square (rms) timing jitter of 130 fs and a carrier-to-noise ratio of 42 dB is obtained. Also, a 40 GHz optical clock with timing jitter of 137 fs is directly recovered from pseudo-non-return-to-zero signals degraded by polarization-mode dispersion (PMD). No preprocessing stage to enhance the clock tone is used. The rms timing jitter of the recovered clock is investigated for different values of input power and for varying amounts of waveform distortion due to PMD.