Hi, the attached patch implements the SYSTEM_CLOCK intrinsics on the MinGW and Cygwin targets using the GetTickCount/GetTickCount64 functions. These should be quite robust monotonic clocks and AFAICS are the best we can do on Windows. See e.g. http://www.python.org/dev/peps/pep-0418/ for details.
As I don't have a Windows system to test on, I would appreciate if somebody more familiar with that platform could take a quick look. In particular, I *think* it should be Ok to use win32 API functions on Cygwin (that is, cygwin-gcc ships the windows.h and other necessary headers out of the box?), and that _WIN32 is the correct macro to use to select code which is common to MinGW and Cygwin. Ok for trunk? 2013-04-12 Janne Blomqvist <j...@gcc.gnu.org> PR fortran/56919 * intrinsics/time_1.h: Use _WIN32 instead of __MINGW32__ to catch both MinGW and Cygwin. * intrinsics/system_clock.c (system_clock_4): Use GetTickCount on _WIN32. (system_clock_8): Use GetTickCount64 or fallback to GetTickCount on _WIN32. * configure.ac (AC_CHECK_FUNCS_ONCE): Check presence of GetTickCount64. * config.h.in: Regenerated. * configure: Regenerated. -- Janne Blomqvist
sysclockwin.diff
Description: Binary data