Divide code for n^2 and n*logn difficulties. Change measure of time.