app/flow-perf: change clock measurement
authorWisam Jaddo <wisamm@nvidia.com>
Thu, 26 Nov 2020 11:15:42 +0000 (13:15 +0200)
committerThomas Monjalon <thomas@monjalon.net>
Thu, 7 Jan 2021 14:28:06 +0000 (15:28 +0100)
commitb9a9404fa9906ce744f14d9b01b5d5bdf6adf51e
treeec383b060766ddf2cd8fe59df80265fc3a875c2b
parent070316d01d3e354154abec9b0eb4b8d2990c872b
app/flow-perf: change clock measurement

The clock() function is not good practice to use for multiple
cores/threads, since it measures the CPU time used by the process
and not the wall clock time, while when running through multiple
cores/threads simultaneously, we can burn through CPU time much
faster.

As a result this commit will change the way of measurement to use
rd_tsc, and the results will be divided by the processor frequency.

Signed-off-by: Wisam Jaddo <wisamm@nvidia.com>
Reviewed-by: Alexander Kozyrev <akozyrev@nvidia.com>
Reviewed-by: Suanming Mou <suanmingm@nvidia.com>
app/test-flow-perf/main.c