Energy relaxation time in NbN and YBCO thin films under optical irradiation