Post list: add benchmark, remove position reset

itemized2sql
Georg Lukas 2010-08-08 20:56:11 +02:00
rodzic b1f99cecab
commit 35ea91b967
2 zmienionych plików z 19 dodań i 2 usunięć

Wyświetl plik

@ -34,8 +34,8 @@ class APRSdroid extends Activity with OnClickListener
lazy val locReceiver = new BroadcastReceiver() {
override def onReceive(ctx : Context, i : Intent) {
val l = i.getParcelableExtra(AprsService.LOCATION).asInstanceOf[Location]
postcursor.requery()
postlist.setSelection(0)
Benchmark("requery") { postcursor.requery() }
//postlist.setSelection(0)
setupButtons(AprsService.running)
}
}

Wyświetl plik

@ -0,0 +1,17 @@
package de.duenndns.aprsdroid
import _root_.android.util.Log
object Benchmark {
def apply[T](tag: String)(block: => T) {
val start = System.currentTimeMillis
try {
block
} finally {
val exectime = System.currentTimeMillis - start
Log.d(tag, "exectuion time: %.3f s".format(exectime / 1000.0))
}
}
}