2020-04-25 17:20:12 +02:00
|
|
|
package info.nightscout.androidaps.utils
|
|
|
|
|
2021-09-21 21:57:56 +02:00
|
|
|
import info.nightscout.androidaps.annotations.OpenForTesting
|
2020-04-25 17:20:12 +02:00
|
|
|
import info.nightscout.androidaps.logging.AAPSLogger
|
|
|
|
import info.nightscout.androidaps.logging.LTag
|
|
|
|
import javax.inject.Inject
|
|
|
|
import javax.inject.Singleton
|
|
|
|
|
2021-09-21 21:57:56 +02:00
|
|
|
@OpenForTesting
|
2020-04-25 17:20:12 +02:00
|
|
|
@Singleton
|
|
|
|
class Profiler @Inject constructor(val aapsLogger: AAPSLogger) {
|
|
|
|
|
|
|
|
fun log(lTag: LTag, function: String, start: Long) {
|
2021-10-15 13:24:22 +02:00
|
|
|
val milliseconds = System.currentTimeMillis() - start
|
|
|
|
aapsLogger.debug(lTag, ">>> $function <<< executed in $milliseconds milliseconds")
|
2020-04-25 17:20:12 +02:00
|
|
|
}
|
|
|
|
}
|