i'm currently a student and i'm studying computer science and engineering so we are learning about algorithms but i'm in hard time and can't understand clearly how to find complexity time of a algorithm

here i have one example:

begin Input: n(pos. Integer) Output: y(pos. Integer) Other: x,z(pos. Integer) x:= 2*n y := 0; while x>0 do y:=y+1; z:=0; while z<2 do x := x - 1; z := z+1; end

Can someone tell me how to find time complexity for this code or to any other algorithm ??

Thanks!

help is appreciated.