How the below verilog code run when it find positive edge of clock?
In this case, the execution order should be as follows (in this exact order):

Time X:    if-statement
Time X+5:  case
Time X+5:  Statement 1
Time X+10: Statement 2


What you are running into is confusion about blocking vs non-blocking assignment. This is a nice example as to why it is called non-blocking assignment. When you hit the line #5 window[i]&lt;=douta;, the simulator will wait 5 time units, then schedule window[i] to take on the value of douta at the end of the current time step. Because you used the non-blocking assignment operator, the execution of the always block continues to the next statements, which is the case statement. Since the assigns here are blocking assignments, they are executed immediately. Then, the #5 is hit (after the case), so the scheduler schedules the next execution for 5 time units in the future. Then it moves on to anything else it needs to do. Finally, it comes back (still within time step X+5) and completes all the non-blocking assignments (like window[i]&lt;=douta). Thats why you are seeing what looks like non-inorder execution of your always block.