We propose a technique for timing an X-ray free-electron laser (XFEL) to a high-power conventional laser with femtosecond accuracy, yielding the relative jitter between pump and X-ray probe, and allowing sorting of experimental results over a certain time window. The same electron bunch is used to produce both an XFEL pulse and an ultrashort optical pulse by means of an optical radiator downstream of the X-ray undulator. Being produced by the same electron bunch, these pulses are perfectly synchronized. Cross-correlation techniques will allow to determine relative jitter between the optical pulse (and, thus, the XFEL pulse) and a pulse from an external pump-laser. Technical realization of the proposed timing scheme uses an optical-replica synthesizer setup to be installed after the final bunch-compression stage of the XFEL for electron bunch diagnostics purposes. A number of critical issues are quantitatively analyzed. (C) 2008 Elsevier B.V. All rights reserved.