Try google with the function name and "MSDN" as search string. Usually the first hit is the Microsoft Developer Network Documentation. That's an awesome documentation site about practically all Windows-API functions in any language supported by Microsoft. It usually also has some examples of usage.
If you still get stuck, make a small program showing your problem and try again in the Windows Programming Forum.
The idea is that you call QueryPerformanceFrequency() once to get the frequency, then you call QueryPerformanceCounters() at each checkpoint. The difference divided by the frequency gives you time difference in seconds. You can get something like 100 nano-sec accuracy on a standard modern Intel box.
The number type is large, LARGE_INTEGER in fact, with is a 64 integral value. When you do the divide, remember to do a floating point divide.
thanks alot for your help
i did the following and the problem was that i did not include windows.h
LARGE_INTEGER t1,t2,freq;
QueryPerformanceCounter(&t1);
for( int i = 0 ; i < size ; i++)
for(int j = 0 ; j < size ; j++)
for(int k = 0 ;k < size ; k++)
C[i][k] += A[i][j]* B[j][k];
QueryPerformanceCounter(&t2);
QueryPerformanceFrequency( &freq );
cout<<(t2.QuadPart-t1.QuadPart)/freq.QuadPart;
the code works
but i am wondering what is defferent between
getting process time by using function clock() and QueryPerformanceCounters()
since i read that clock is not accurate to get the process time(wall clock ) while QPC gives accurate time of process
for me , both of them gave approxi same results
The clock functions, based on GetSystemTime, sample time in a different way (at a lower rate), and so have a lower resolution.
If a box has special timer hardware, it'll hook into the QueryPerformance functions. So if you always use those, you'll pickup fancy hardware by default.