Its not always simple
To find the complexity of an algorithm can't be done with simple commands or testing the algorithm without understanding the test case and how the algorithm operates. If you were to submit a case of n objects to the algorithm it processes them in "n" time. If you increase this by 2 then it processes in 2N time. The only true way to figure out the complexity is to look at the code. Loops where every "object" that the algorithm is processed is an O(n). You can look for nested loops, if for every object, all n objects are processed, you have an O(n^2). Its very complex and hard to explain, you might want to read the Wikipedia article in full.