strange problem about the execution speed time

i have a strange problem in one of my programs, this mean it doesn't always take the same time to finish tehe programm on the school server, i fastly made a test programm and it doesnt either have always the same execution time. Could it be that the Interpretation of the java code doesn't always take the same time?

here is my test code :

import java.io.*;

import java.util.*;

public class test2{

public static void main (String args[]){

int i,j, k; //nombre de reines

int tmp=0;

Date start=new Date();

for (i=0; i<30000; i++) {

for (j=0; j<30000;j++) {

for (k=0; k<1; k++) {

tmp += 1;

tmp -= 1;

}

}

}

Date stop=new Date();

long temps=stop.getTime()-start.getTime();

System.out.println("Temps d'�x�cution: "+temps+" secondes");

}

}

the ressources on the server are always the same so it can't be because of surpopulation on the server.

if anyone has an idea, that could help me a lot.

thanks.

[1071 byte] By [bronze-starDukes] at [2007-11-26 12:11:04]
# 1
take ecran de merde and run it through babelfish french -> english
platinumsta at 2007-7-7 14:08:57 > top of Java-index,Archived Forums,Socket Programming...
# 2
Where did you find specification about time of execution? Nobody can say will program complete in one second or in one hour.> the ressources on the server are always the sameWho said?
bronzestar at 2007-7-7 14:08:57 > top of Java-index,Archived Forums,Socket Programming...
# 3

sorry, it's hard form me to exprees the priblem in english but i don't understand why the value of temps can sometime double between two executions, it should be the same +- a few milliseconds.

concerning the ressources on the server the command top under linux gives always the same information about the allowed CPU when i run the test.

bronzestar at 2007-7-7 14:08:57 > top of Java-index,Archived Forums,Socket Programming...
# 4

There are a lot of factors. May be your server's memory module has corrupted area and some time required for recovering from error? Or java executables cached into memory and second execution is faster then first one. Or something else. Again - there is no any guaranties about time of execution.

bronzestar at 2007-7-7 14:08:57 > top of Java-index,Archived Forums,Socket Programming...