Work out how many seconds a thread ran for
Code:
#include "stdafx.h"
#include <Windows.h>
DWORD WINAPI test_thread(LPVOID Param)
{
MessageBox(NULL,"test_thread started ","",0);
for(int i = 0; i < 99999999999; i++)
{
}
//i would like to work out how many seconds that loop ran for
MessageBox(NULL,"test_thread over","",0);
return 0;
}
int _tmain(int argc, _TCHAR* argv[])
{
HANDLE test_thread_handle = CreateThread(NULL,0,(LPTHREAD_START_ROUTINE)test_thread,NULL,NULL,NULL);
WaitForSingleObject(test_thread_handle,INFINITE);
return 0;
}