The time complexity is O(n2).
There are 8 corners, 12(n-2) edge pieces and 6(n-2)2 face pieces. Add everything together and you get a quadratic function which is nearly equal to O(n2).
I hope this helps. Please contact me if you would like additional help.