tk = k * dt + ek
This formula rather matches a single measurement for the whole k-frames duration, but you said you were cumulating single frame times, which would rather be expressed as:
tk = sum(dt + ek)
Sorry to go on about this, but I did say that I am cumulating the deltas *inside an animated sequence*. My software switches between showing still images and animated sequences, which happens when the user zooms, pans, etc.. So my measurement does indeed look at an average over several k-frame durations. I have a frame counter counter which is reset to zero whenever the system is at rest. When I get to the call to display I look at this counter, and if it's greater than zero, I know the previous frame was already inside the animation sequence and I cumulate the delta. Cumulating single deltas has the advantage that the average is right at hand at every moment, rather than having to bother with recording sequence starting times and counting frames per sequence.
When it comes to cumulating individual independent measurements, you and Hapax are of course totally right about the error cumulating, and the formulta you give is the correct one to use.
Here's the relevant part of the code I'm using:
p_window->display() ;
display_called = std::chrono::system_clock::now() ;
float dt = std::chrono::duration_cast<std::chrono::microseconds>
(display_called - display_last_called).count() ;
dt /= 1000.0 ; // use float milliseconds
display_last_called = display_called ;
if ( frames_in_sequence > 1 )
{
dt_count++ ;
total_ms += dt ;
if ( dt_count > 20 ) // only start using dt_average after having cumulated 20 deltas
dt_average = total_ms / dt_count ;
}