Generally speaking when you are dealing with a sorted list like `times` then `np.searchsorted` is your friend for selecting an interval.  It's faster O(logN) vs O(N) and uses essentially no additional memory.  Using masking here ends up creating 4 bool arrays of length N.  Doesn't matter here, but it's good to use the right tools.