theapache64
05/09/2023, 9:49 AMAlbert Chang
05/09/2023, 10:00 AMSystem.currentTimeMillis()
to measure elapsed time. Use System.nanoTime()
or SystemClock.elapsedRealtime()
on Android.CLOVIS
05/09/2023, 10:01 AMAlbert Chang
05/09/2023, 10:02 AMtheapache64
05/09/2023, 10:03 AMdoFrame
call here anyway. but what’s the issue with currentTimeMillis
?Albert Chang
05/09/2023, 10:05 AMtheapache64
05/09/2023, 10:08 AM@Composable
inline fun MeasureComposition(
tag: String,
content: @Composable () -> Unit
) {
val timestamp = System.nanoTime()
content()
val diff = System.nanoTime() - timestamp
println("$tag took for recomposition: ${diff / 1_000_000}ms")
}
marstran
05/09/2023, 10:13 AMmeasureTime
functions in Kotlin: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.time/measure-time.htmlyschimke
05/09/2023, 10:16 AMtheapache64
05/09/2023, 10:17 AMyschimke
05/09/2023, 10:18 AMtheapache64
05/09/2023, 10:20 AMshikasd
05/09/2023, 12:43 PMComposer.setTracer
to hook into tracing APIs, but that's going to override default tracing trackertheapache64
05/09/2023, 12:59 PMtraceEventStart
will be called for each recomposition and if its shows my composable name like this, it means it got recomposed? What else we can do with this? how can i get more data? Can i get entire doFrame
call time at the Runtime? ( I’d like to get the measure time as well).. (sorry for asking too many questions at once 😄 this API looks exciting 😬 )shikasd
05/09/2023, 1:01 PMmlykotom
05/09/2023, 4:08 PMTraceSectionMetric
from Macrobenchmark.theapache64
05/09/2023, 4:09 PM.trace
file right? I am trying to get those info at runtimemlykotom
05/09/2023, 4:43 PMyschimke
05/09/2023, 6:28 PMPerfettoTrace.record {}
and PerfettoTraceRule
to capture Perfetto traces (also known as System Traces) as part of a test, to inspect test behavior and performance.Ian G. Clifton
05/11/2023, 8:20 PM