For testing purposes frames containing random data can be produced using the TXFRAME host command. However, when this feature was added, seeding of the pseudo-random number generator was not implemented, so it always produced the same "random" data. srand(time(0)) is commonly used to provide a time dependent seed. However, time(0) changes only once per second, so running ardopcf more than once per second, which might occur during testing, would produce duplicate values. So, gettimeofday(), with microsecond resolution is used instead.
For testing purposes frames containing random data can be produced using the TXFRAME host command. However, when this feature was added, seeding of the pseudo-random number generator was not implemented, so it always produced the same "random" data. srand(time(0)) is commonly used to provide a time dependent seed. However, time(0) changes only once per second, so running ardopcf more than once per second, which might occur during testing, would produce duplicate values. So, gettimeofday(), with microsecond resolution is used instead.