Windows high resolution timing class I'm attempting to implement a high resolution class used to time the execution time of functions in Windows. After using this documentation, I have come up with the following:
#include &lt;iostream&gt;
#include &lt;windows.h&gt;

class Timer {

private:

    LARGE_INTEGER start_count;
    LARGE_INTEGER stop_count;

    LARGE_INTEGER tick_freq;

public:
    // Query the tick frequency upon instantiation of the class
    Timer() {
        QueryPerformanceFrequency(&amp;tick_freq);
    }
    // Query performance counter at the start of a block of code
    void start() {
        QueryPerformanceCounter(&amp;start_count);
    }
    // Query the performance counter at the end of a block of code, then calculate time elapsed in seconds
    double stop() {
        QueryPerformanceCounter(&amp;stop_count);
        return (double)(stop_count.QuadPart - start_count.QuadPart) / tick_freq.QuadPart;
    }
};

int main() {
    Timer t;
    t.start();
    // code to be timed
    std::cout &lt;&lt; t.stop();
}

I understand that there would be an error of plus or minus the period of each tick. However, various functions I have timed seem to give unexpected results. For example, timing a function that finds the greatest common denominator using Euclid's algorithm consistently uses 100 or 200ns, but appending one int to a vector takes 1600ns. This therefore leads me to the question: how accurate is this timing class, and what can I do to improve it?
Avoid storing data unnecessarily
Your class stores the start time, stop time and frequency in member variables, however you only need to store the start time:
class Timer {
    LARGE_INTEGER start_count;

public:
    // Query performance counter at the start of a block of code
    void start() {
        QueryPerformanceCounter(&amp;start_count);
    }

    // Query the performance counter at the end of a block of code, then calculate time elapsed in seconds
    double stop() {
        LARGE_INTEGER stop_count;
        QueryPerformanceCounter(&amp;stop_count);

        LARGE_INTEGER tick_freq_count;
        QueryPerformanceFrequency(&amp;tick_freq);
        return (double)(stop_count.QuadPart - start_count.QuadPart) / tick_freq.QuadPart;
    }
};

Consider using std::chrono functions
If you can use C++11 or later, then you should be able to get the same timing information in a platform-independent way by using std::chrono::high_resolution_clock. See this example for how it can be used.
Accuracy
The actual accuracy depends on many things. The inherent accuracy depends on the accuracy of the performance counter of the CPU, which can vary between models. However, there are many reasons why the measured time will vary, among them are:

The state of the cache (as suggested by Casey, you should do a warm-up run before doing the actual performance measurements)
The CPU frequency changes (the OS will normally adjust the frequency many times per second to ensure your processor runs as energy efficient as possible)
Other threads might get a timeslice while your code is running

You could try to address all these issues yourself (many of them are solved by doing a warm-up run, then running your performance measurements many times and taking the average, removing outliers in some way). Alternatively, consider using existing libraries that already solve this problem, for example Google Benchmark.