On 27 June 2016 at 08:50, Anaswara Nair <anaswara.nn@gmail.com> wrote:
The execution time includes the time to read the data from the file and insert it to the container.

 So start timing after you loaded the file. The way you load the file might affect the load-time. std::iostreams might not give the best performance, and is obviously highly affected by hardware, STL-implementation and underlying OS.

Also I am using std::chrono to calculate the time.

Use std::chrono::high_resolution_clock.
 
Is there some other way by which I can pause the calculation when data is read from the file and resume it again only when data is inserted to the container?

You could just keep a running total and pause and resume as appropriate for your measurement, adding the individual measurements to the total time.
 
It all smells a bit of premature optimization to me.

d.