-3

The following function is not compiling:

double GetCurTime()
{
    LARGE_INTEGER CounterFreq;
    QueryPerformanceFrequency(&CounterFreq);

    LARGE_INTEGER Counter;
    QueryPerformanceCounter(&Counter);
    return (double)Counter.QuadPart / (double)CounterFreq.QuadPart;
}

The C the compiler I am using does not recognize LARGE_INTEGER and QueryPerformanceFrequency.

If anyone recognizes these items, can you please suggest where I might find them?
Perhaps they are in a header file, or a library that I do not currently have.

ryyker
  • 22,849
  • 3
  • 43
  • 87
  • 1
    So, whats your question? – Osiris Dec 19 '18 at 18:08
  • There is a very similar question _[HERE](https://stackoverflow.com/questions/1739259/how-to-use-queryperformancecounter)_ that has a detailed answer to how to use `QueryPerformanceCounter`. – ryyker Dec 19 '18 at 21:57
  • Possible duplicate of [How to use QueryPerformanceCounter?](https://stackoverflow.com/questions/1739259/how-to-use-queryperformancecounter) – ryyker Dec 19 '18 at 21:59

1 Answers1

2

Include the <time.h> library and use the time_t time(time_t *timer); function.

Also, if you want to use QueryPerformanceCounter, then you need to include Winbase.h (and Windows.h).

John
  • 1,012
  • 14
  • 22