?? test.java
字號:
class Test
{
public static void main(String args[])
{
System.gc();
long start = System.currentTimeMillis();
for (int i=0; i<100000; i++)
{
Light lgt = new Light(1);
}
long end = System.currentTimeMillis();
long val = end-start;
System.out.println("Light is " + (end-start));
System.gc();
start = System.currentTimeMillis();
for (int i=0; i<1; i++)
{
Heavy hvy = new Heavy(4, true);
}
end = System.currentTimeMillis();
System.out.println("heavy is " + (end-start));
val = (end-start)/val;
System.out.println("heavy is " + val + " times more expensive");
System.exit(0);
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -