kopia lustrzana https://github.com/ge0rg/aprsdroid
Post list: add benchmark, remove position reset
rodzic
b1f99cecab
commit
35ea91b967
|
@ -34,8 +34,8 @@ class APRSdroid extends Activity with OnClickListener
|
||||||
lazy val locReceiver = new BroadcastReceiver() {
|
lazy val locReceiver = new BroadcastReceiver() {
|
||||||
override def onReceive(ctx : Context, i : Intent) {
|
override def onReceive(ctx : Context, i : Intent) {
|
||||||
val l = i.getParcelableExtra(AprsService.LOCATION).asInstanceOf[Location]
|
val l = i.getParcelableExtra(AprsService.LOCATION).asInstanceOf[Location]
|
||||||
postcursor.requery()
|
Benchmark("requery") { postcursor.requery() }
|
||||||
postlist.setSelection(0)
|
//postlist.setSelection(0)
|
||||||
setupButtons(AprsService.running)
|
setupButtons(AprsService.running)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue