Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "Counter.h"
- void Counter::startCounter() {
- LARGE_INTEGER li;
- if (!QueryPerformanceFrequency(&li))
- std::cout << " Blad dla QueryPerformanceFrequency!\n";
- PCFrequency = double(li.QuadPart) / 1000000.0; //mikrosekundy
- //1000.0 milisekundy
- QueryPerformanceCounter(&li);
- CounterStart = li.QuadPart;
- }
- double Counter::getCounter() {
- LARGE_INTEGER li;
- QueryPerformanceCounter(&li);
- return double(li.QuadPart - CounterStart) / PCFrequency;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement