Closed MathieuBordere closed 4 years ago
You are right, thanks for spotting this :)
The code is correct, it's the comment that is wrong. It's supposed to switch at 1.2 million packets per second, i.e. 1200 packets per millisecond which is the constant being used here: https://github.com/emmericp/ixy/blob/1e1aff492ad2d66405303412c01caf0ad099053e/src/interrupts.h#L10
micro = 10 ^ -6 nano = 10 ^ -9
By using
(elapsed_time_nanos / 1000000)
, this function calculates the amount of received packets per millisecond, so I don't know if the comments are wrong micro -> milli or the divisor is wrong 1000000 -> 1000.