开发者

Android -- can System.out.println() significantly decrease performance like it does on a PC

System calls are 开发者_如何学JAVAvery expensive. System.out.println() can bring an app to its knees if ran inside a loop. Does it affect the console-less android similarly?


Ran a quick test for you using a 10000000 iteration loop.

Empty ~ 200ms System.out.println() ~ 5600ms System.out.println("abcdefghijklmnop") ~ 90000ms

Up to you apply that to your situation whether it is acceptable or not.

Btw it doesn't do nothing, it prints to the device log

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜