Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- double PCFreq = 0.0;
- __int64 CounterStart = 0;
- void StartCounter()
- {
- LARGE_INTEGER li;
- if(!QueryPerformanceFrequency(&li))
- cout << "QueryPerformanceFrequency failed!\n";
- PCFreq = double(li.QuadPart)/1000.0;
- QueryPerformanceCounter(&li);
- CounterStart = li.QuadPart;
- }
- double GetCounter()
- {
- LARGE_INTEGER li;
- QueryPerformanceCounter(&li);
- return double(li.QuadPart-CounterStart)/PCFreq;
- }
- /* instrukcja obslugi:
- double czas = 0.0;
- StartCounter();
- //funkcja, ktorej czas dzialania mierzysz
- czas = GetCounter();
- w czas będzie czas w ms, by dostac inna jednostke mozna manipulowac mianownikiem PCFreq = double(li.QuadPart)/1000.0;
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement