This function is similar to _happens_directly_before, but it should work better for intra-thread durations.