@PeterLawrey did the math, here are the graphs on the graph ( my dataset is n compared to the runtime in microseconds).
Basically, I run the specified code several times using another input n (X axis). Then I divided the average runtime into functions n^5 , n^4 and n^3 and built it like this:

Full size image
Note that this is a logarithmic scale and that all functions are scaled to more or less in the same range.
Guess that the runtime avergae t(n) divided by n^5 continues to decrease, and t(n)/n^3 continues to grow. Only t(n)/n^4 stabilizes when approaching infinity, which proves that the average execution time is actually O(n^4) .
source share