Click here to Skip to main content
15,908,834 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: How is this possible? Pin
Richard MacCutchan17-May-20 5:31
mveRichard MacCutchan17-May-20 5:31 
GeneralRe: How is this possible? Pin
Tim ONeil17-May-20 5:39
Tim ONeil17-May-20 5:39 
GeneralRe: How is this possible? Pin
Richard MacCutchan17-May-20 6:28
mveRichard MacCutchan17-May-20 6:28 
GeneralRe: How is this possible? Pin
Richard MacCutchan17-May-20 22:12
mveRichard MacCutchan17-May-20 22:12 
GeneralRe: How is this possible? Pin
Richard MacCutchan19-May-20 23:55
mveRichard MacCutchan19-May-20 23:55 
AnswerRe: How is this possible? Pin
Mircea Neacsu19-May-20 3:09
Mircea Neacsu19-May-20 3:09 
PraiseRe: How is this possible? Pin
Greg Utas19-May-20 3:37
professionalGreg Utas19-May-20 3:37 
GeneralRe: How is this possible? Pin
Richard MacCutchan19-May-20 3:37
mveRichard MacCutchan19-May-20 3:37 
GeneralRe: How is this possible? Pin
Mircea Neacsu19-May-20 3:57
Mircea Neacsu19-May-20 3:57 
GeneralRe: How is this possible? Pin
Richard MacCutchan19-May-20 4:16
mveRichard MacCutchan19-May-20 4:16 
GeneralRe: How is this possible? Pin
Mircea Neacsu19-May-20 5:08
Mircea Neacsu19-May-20 5:08 
GeneralRe: How is this possible? Pin
Richard MacCutchan19-May-20 5:24
mveRichard MacCutchan19-May-20 5:24 
GeneralRe: How is this possible? Pin
Mircea Neacsu19-May-20 6:07
Mircea Neacsu19-May-20 6:07 
GeneralRe: How is this possible? Pin
Richard MacCutchan19-May-20 21:36
mveRichard MacCutchan19-May-20 21:36 
GeneralRe: How is this possible? Pin
Mircea Neacsu20-May-20 2:40
Mircea Neacsu20-May-20 2:40 
GeneralRe: How is this possible? Pin
Richard MacCutchan19-May-20 23:22
mveRichard MacCutchan19-May-20 23:22 
GeneralRe: How is this possible? Pin
Mircea Neacsu20-May-20 2:44
Mircea Neacsu20-May-20 2:44 
GeneralRe: How is this possible? Pin
Richard MacCutchan19-May-20 4:18
mveRichard MacCutchan19-May-20 4:18 
AnswerRe: How is this possible? Pin
Richard MacCutchan19-May-20 21:38
mveRichard MacCutchan19-May-20 21:38 
QuestionQueryPerformanceCounter Pin
Calin Negru16-May-20 2:16
Calin Negru16-May-20 2:16 
AnswerRe: QueryPerformanceCounter Pin
Greg Utas16-May-20 2:29
professionalGreg Utas16-May-20 2:29 
Here's how I get the current time (in ticks):
TimePoint SysTickTimer::Now() const
{
   if(available_)  // previously set based on whether high-frequency timing is available
   {
      LARGE_INTEGER now;
      QueryPerformanceCounter(&now);
      return TimePoint(now.QuadPart);  // the current time in ticks (64 bits)
   }
   else  // will only have millisecond accuracy
   {
      _timeb now;
      _ftime_s(&now);
      auto msecs = 1000LL * now.time;
      return TimePoint(msecs + now.millitm);
   }
}
My Windows 10 installation, running on a Dell XPS15, has 10^7 ticks per second (1 tick = 0.1 usecs). This is determined by
LARGE_INTEGER frequency;

if(QueryPerformanceFrequency(&frequency))
{
   available_ = true;
   ticks_per_sec_ = frequency.QuadPart;
}

GeneralRe: QueryPerformanceCounter Pin
Calin Negru16-May-20 3:11
Calin Negru16-May-20 3:11 
AnswerRe: QueryPerformanceCounter Pin
Richard MacCutchan16-May-20 2:58
mveRichard MacCutchan16-May-20 2:58 
GeneralRe: QueryPerformanceCounter Pin
Calin Negru16-May-20 23:00
Calin Negru16-May-20 23:00 
GeneralProject Pin
Hayley Satjan15-May-20 0:32
Hayley Satjan15-May-20 0:32 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.