Thanks for benchmarking it. I forgot that the timestamp is the first element - you're right, creating a new array of IDs removes any advantage sorting might have (and, of course, I could be completely wrong that sorting is worthwhile anyway).
EDIT: removed suggestion to use a single pre-allocated array. That approach does not work here because it forces Search 1D Array to search through a much larger array (even though most of it is unused) each time.
However, I have an idea that may be even faster: use variant attributes. Attributes are stored in a tree so searching for an existing element is fast (no need to compare every single element), and it automatically removes duplicates too! See image below:
EDIT: I benchmarked this. For 2000 elements, the build array and variant approaches are similar. For a 50000 element array, the variant approach is 10x faster (1s for build array, 0.1s for variant). For a small array (a few hundred elements), build array is faster, although the absolute difference in time is pretty minimal at that point.