#include <windows.h> main(){ SYSTEMTIME now1, now2; int time; GetSystemTime(&now1); ....... GetSystemTime(&now2); time=(now2.wSecond-now1.wSecond)*1000+(now2.wMilliseconds-now1.wMilliseconds); }