Measuring execution time in C++
Extend your timer function so it can take all the parameters needed by func()
Don bother to pass func by const reference.

What I would have done
template&lt;typename TimeT = std::chrono::milliseconds&gt;
struct measure
{
    template&lt;typename F, typename ...Args&gt;
    static typename TimeT::rep execution(F func, Args&amp;&amp;... args)
    {
        auto start = std::chrono::system_clock::now();

        // Now call the function with all the parameters you need.
        func(std::forward&lt;Args&gt;(args)...);

        auto duration = std::chrono::duration_cast&lt; TimeT&gt;(std::chrono::system_clock::now() - start);

        return duration.count();
    }
};