AndroidAPS/app/src/main/java/info/nightscout/androidaps/utils/Profiler.kt
2021-12-10 15:19:19 +01:00

17 lines
563 B
Kotlin

package info.nightscout.androidaps.utils
import info.nightscout.androidaps.annotations.OpenForTesting
import info.nightscout.shared.logging.AAPSLogger
import info.nightscout.shared.logging.LTag
import javax.inject.Inject
import javax.inject.Singleton
@OpenForTesting
@Singleton
class Profiler @Inject constructor(val aapsLogger: AAPSLogger) {
fun log(lTag: LTag, function: String, start: Long) {
val milliseconds = System.currentTimeMillis() - start
aapsLogger.debug(lTag, ">>> $function <<< executed in $milliseconds milliseconds")
}
}