Namespaces
Variants
Actions
(Difference between revisions)

Como detectar gargalos no código para poder otimizá-lo

Jump to: navigation, search
m (Hamishwillee - Automated change of category from Lang-PT to Unlikely Category. (Moving))
Line 1: Line 1:
[[Category:Java ME (Português)]]
+
[[Category:Java ME]]
[[Category:Lang-PT]]
+
[[Category:Lang-Portuguese]]
[[Category:Exemplos de código Java ME]]
+
[[Category:Code Examples]]
 
Original: [[How to detect bottlenecks in the code to optimize it]]
 
Original: [[How to detect bottlenecks in the code to optimize it]]
  

Revision as of 08:19, 14 July 2011

Original: How to detect bottlenecks in the code to optimize it

Se você precisa otimizar seu jogo ou aplicação Java ME e você não sabe onde otimizar, você deve usar um Profiler como os tem nos SDKs e você deve testar várias vezes seu código.

Se você quiser saber quantos milissegundos um algoritmo leva para concluir a tarefa em um dispositivo, você deve usar este código:

...
long inicio, fim, duracao;
inicio = System.currentTimeMillis ();
 
// Aqui vai todo o código de verificação
 
duracao = System.currentTimeMillis ();
fim = duracao - inicio;
...
109 page views in the last 30 days.
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved