Replace ftime() with ftime_s()