The application workflow is something like this:
init();
while(packet.read()) {
if (filterpacket(packet))
process(packet); // function to benchmark.
}
Over the course of one full application run, I need the measure the time of process(packet)
. Individually calling process(packet)
in google benchmark won't work because process would change some internal data structure which will affect the timings of the next process(packet)
called. It seems also counter-intuitive to make fixtures for each internal state.
How do I do this with google benchmark?
I know I can simply make some ifdefs/flags and make application version that measures the time taken by process(packet)
but that would defeat the purpose of google benchmark. My expected time of the process(packet)
is too small, of the order of 200ns.