Advertisement
Guest User

Untitled

a guest
Jun 24th, 2013
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.53 KB | None | 0 0
  1.     static long long timestamp()
  2.     {
  3.         //From http://gamedev.stackexchange.com/questions/26759/best-way-to-get-elapsed-time-in-miliseconds-in-windows
  4.         static LARGE_INTEGER s_frequency;
  5.         static BOOL s_use_qpc = QueryPerformanceFrequency(&s_frequency);
  6.         if (s_use_qpc)
  7.         {
  8.             LARGE_INTEGER now;
  9.             QueryPerformanceCounter(&now);
  10.             return (1000LL * now.QuadPart) / s_frequency.QuadPart;
  11.         }
  12.         else
  13.         {
  14.             return GetTickCount();
  15.         }
  16.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement