jeudi 27 avril 2017

Precision of std::chrono::duration

I have stored in a std::chrono::duration<double> variable the duration of my algorithm and I want to repeat the experiment a few times (let's say 3 times) so I want to store in a vector the three durations to calculate the mean.

I use a vector of double (storing time.count()).

The duration are, more or less,

0.003,

0.004,

0.003

and when I calculate the mean (using a double) the result is 0.

Is there anyway to have more precision when calculating the mean?

Aucun commentaire:

Enregistrer un commentaire