Calibration and performance of the AMS-02 time of flight detector in space