I have a JSP contains high amount of HTML code. There are many inner divs, spans and h2 tags. The HTML code is generated by scriplets using some for loops.
I measure the scriptlet process by using the following :
   <% long time = System.currentTimeMillis(); %>
     // here is the entire page data
   <% System.out.println("Time : " + (System.currentTimeMillis()-time)); %>
According to this measurement, the process time is 300-350 msecs.
To spot the parts that make the delay, I did something like that :
    <% long time = System.currentTimeMillis(); %>
         // Some HTML Blocks
    <% System.out.println("Time1 : " + (System.currentTimeMillis()-time)); %>
         // Another HTML Blocks
    <% System.out.println("Time2 : " + (System.currentTimeMillis()-time)); %>
However, I realised that sometimes even if I do the following, even there is no html block between printlns, the time value is still changes !
   <% long time = System.currentTimeMillis(); %>
             // Some Blocks
   <% System.out.println("Time1 : " + (System.currentTimeMillis()-time)); %>
   <% System.out.println("Time2 : " + (System.currentTimeMillis()-time)); %>
Output is :
Time1 : 65
Time2 : 208
So what is the thing that slow down my page ? How can I detect the point?
Do the Scriptlets have performance weakness for processing heavy HTML codes?
----- UPDATE ------
Here is the output :
 first : 0
 Sec : 0
 thr : 0
 fr : 180
 Total : 180
There is nothing between thr and fr but fr value is 180 !

 
    