diff --git a/dlls/msvcrt/tests/time.c b/dlls/msvcrt/tests/time.c index 6865e3d2691..bc1c6c8d1ab 100644 --- a/dlls/msvcrt/tests/time.c +++ b/dlls/msvcrt/tests/time.c @@ -875,18 +875,18 @@ static void test__tzset(void) static void test_clock(void) { - static const int THRESH = 50; - clock_t s, e; - int i; + static const int THRESH = 100; + FILETIME start, cur; + int c, expect; - for (i = 0; i < 10; i++) - { - s = clock(); - Sleep(1000); - e = clock(); + ok(GetProcessTimes(GetCurrentProcess(), &start, &cur, &cur, &cur), + "GetProcessTimes failed with error: %d\n", GetLastError()); + GetSystemTimeAsFileTime(&cur); + expect = (((LONGLONG)cur.dwHighDateTime<<32)+cur.dwLowDateTime - + ((LONGLONG)start.dwHighDateTime<<32)-start.dwLowDateTime) / 10000; - ok(abs((e-s) - 1000) < THRESH, "clock off on loop %i: %i\n", i, e-s); - } + c = clock(); + ok(abs(c-expect) < THRESH, "clock() = %d, expected %d\n", c, expect); } START_TEST(time)