I have a code in C and in assembly (x86 on linux) and I would like to compare their speed, but I don't know how to do it.
In C, the time.h library allows us to know the execution time of the program. But I don't know how to do that in assembly.
I have found the instruction rdtsc which allows us to know the number of clock cycles between two pieces of code. But I have the impression that there is a huge noise on the returned value (maybe because of what is running on the pc?) I don't see then how to compare the speed of these two programs. The time observed in the command prompt is apparently not a reference...
How should I proceed ? Thanks
I have tried to substitute values that I got with the assembly programm with the values I got from an empty code in order to have an average value, but values are still incoherent