Retrieve number of milliseconds elapsed since the system was started
UINT GetTickCount( )
the number of milliseconds ellapsed since the system was restarted.
// This example measures how much time (in milliseconds) it takes
// to execute an empty for-loop of 1000.
DWORD dw1 = GetTickCount();
for(int ii = 0; ii < 1000; ii++)
printf("Empty loop of 1000 takes %d ms\n",GetTickCount()-dw1);
The GetTickCount function retrieves the number of milliseconds that have elapsed since the system was started.
It is limited to the resolution of the system timer.
It is often used to measure time needed to complete an operation (see the example).