The ANTARES experiment consists of an array of photomultipliers distributed along 12 lines and located deep underwater in the Mediterranean Sea. It searches for astrophysical neutrinos collecting the Cherenkov light induced by the charged particles, mainly muons, produced in neutrino interactions around the detector. Since at energies of $sim$10 TeV the muon and the incident neutrino are almost collinear, it is possible to use the ANTARES detector as a neutrino telescope and identify a source of neutrinos in the sky starting from a precise reconstruction of the muon trajectory. To get this result, the arrival times of the Cherenkov photons must be accurately measured. A to perform time calibrations with the precision required to have optimal performances of the instrument is described. The reconstructed tracks of the atmospheric muons in the ANTARES detector are used to determine the relative time offsets between photomultipliers. Currently, this method is used to obtain the time calibration constants for photomultipliers on different lines at a precision level of 0.5 ns. It has also been validated for calibrating photomultipliers on the same line, using a system of LEDs and laser light devices.