rootuss

Untitled

Mar 26th, 2020
236
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include "Counter.h"
  2.  
  3. void Counter::startCounter() {
  4.     LARGE_INTEGER li;
  5.     if (!QueryPerformanceFrequency(&li))
  6.         std::cout << " Blad dla QueryPerformanceFrequency!\n";
  7.  
  8.     PCFrequency = double(li.QuadPart) / 1000000.0;      //mikrosekundy
  9.                                                         //1000.0 milisekundy
  10.     QueryPerformanceCounter(&li);
  11.     CounterStart = li.QuadPart;
  12. }
  13.  
  14. double Counter::getCounter() {
  15.     LARGE_INTEGER li;
  16.     QueryPerformanceCounter(&li);
  17.     return double(li.QuadPart - CounterStart) / PCFrequency;
  18. }
RAW Paste Data