第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定

junit的使用,自定義的與idea生成的測試類,結(jié)果為什么有比較大的出入

@Test
public?void?testPerformance()?throws?Exception?{
????System.out.println("性能測試:");
????//測試DOM的性能
????long?start?=?System.currentTimeMillis();
????domXmlParser();
????System.out.println("DOM:"?+?(System.currentTimeMillis()?-?start));
????//測試SAX的性能
????start?=?System.currentTimeMillis();
????saxXmlParser();
????System.out.println("SAX:"?+?(System.currentTimeMillis()?-?start));
????//測試JDOM的性能
????start?=?System.currentTimeMillis();
????jdomXmlParser();
????System.out.println("JDOM:"?+?(System.currentTimeMillis()?-?start));
????//測試DOM4J的性能
????start?=?System.currentTimeMillis();
????dom4jXmlParser();
????System.out.println("DOM4J:"?+?(System.currentTimeMillis()?-?start));
}

上述的自定義的方法,測試結(jié)果如下:

http://img1.sycdn.imooc.com//597765220001938118410276.jpg

idea生成測試類代碼如下:

public?class?ParseTestTest?{
????@org.junit.Test
????public?void?domXmlParser()?throws?Exception?{

????}

????@org.junit.Test
????public?void?saxXmlParser()?throws?Exception?{

????}

????@org.junit.Test
????public?void?jdomXmlParser()?throws?Exception?{

????}

????@org.junit.Test
????public?void?dom4jXmlParser()?throws?Exception?{

????}

}

運(yùn)行結(jié)果如下:

http://img1.sycdn.imooc.com//597765590001917119040296.jpg


為什么idea生成的時(shí)間較短,而且除dom解析外其他解析沒時(shí)間或幾乎沒時(shí)間呢

正在回答

1 回答

首先編譯器不同,單位指標(biāo)不同。還有一點(diǎn),數(shù)據(jù)量太小了,不能說明所有問題

0 回復(fù) 有任何疑惑可以回復(fù)我~

舉報(bào)

0/150
提交
取消

junit的使用,自定義的與idea生成的測試類,結(jié)果為什么有比較大的出入

我要回答 關(guān)注問題
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)