How to get the time elapsed in C in milliseconds? (Windows)

后端 未结 6 1896
栀梦
栀梦 2021-02-14 09:39

I\'ve searched in the Web but I\'ve only found a way for do it, but in this way it returns in seconds instead of milliseconds.

My code is:

#include 

        
6条回答
  •  不要未来只要你来
    2021-02-14 10:27

    DWORD start = GetTickCount();
    executeSmth();
    printf("Elapsed: %i ms", GetTickCount() - start);
    

    P.S. This method has some limitations. See GetTickCount.

提交回复
热议问题