In theory, thread A can be active all the time, but in thread B,
epoll_wait(-1) can block e.g. 0.5 seconds. Then the first sample generated
in B for this "interval" is 0.5 seconds behind the sample in A for the same
interval. But it should be fine if that sample is neither the first nor the
last one. We can also change to epoll_wait(10ms) (1/100 of the interval) so
a sample is guaranteed to be generated within 10ms when a new interval
starts.