C: Different implementation of clock() in Windows and other OS?

You’re encountering a known bug in Microsoft’s C Runtime. Even though the behavior is not conforming to any ISO C standard, it won’t be fixed. From the bug report:

However, we have opted to avoid reimplementing clock() in such a way that it might return time values advancing faster than one second per physical second, as this change would silently break programs depending on the previous behavior (and we expect there are many such programs).

Leave a Comment