*/
class GetTime
{
public static final void getTime()
{
long start = System.currentTimeMillis();
runcode();
long end=System.currentTimeMillis();
System.out.println("毫秒:"+(end-start));
}
public static void runcode()
{
for(int x=0;x<=100;x++)
System.out.println(x);
}
}
class SubTime extends GetTime
{
public static void runcode()
{
for(int x=0;x<10000;x++)
System.out.println(x);
}
}
public class Template
{
public static void main(String[]agrs)
{
GetTime.getTime();//1-100
SubTime.getTime();//1-100 两个运行结果一样!