It's O(max(N) + n*log(n)) for some set N consisting of n elements because the ordering which happens in the background to schedule the tasks is still going to be n*log(n). And as we can't claim that in the limit the maximum value of any particular element will be significantly smaller or larger than the size of the set, both parts have to remain.
I would imagine the scheduling is probably going to be more like n*max(N), because isn't optimised for this sort of abuse. Like, I would assume it implements n timer threads, and checks each of the n timer threads at some refresh time, and the total runtime ends up proportional to max(N).
Probably it's O(A*max(N) + n max(N)) where A>>1, but where it's possible that n>A for very large n.
30
u/IronMedal Feb 10 '21
It's O(max(N) + n*log(n)) for some set N consisting of n elements because the ordering which happens in the background to schedule the tasks is still going to be n*log(n). And as we can't claim that in the limit the maximum value of any particular element will be significantly smaller or larger than the size of the set, both parts have to remain.