Fix job deletion bug, add performance tests.

This commit is contained in:
Greyson Parrelli
2024-07-18 10:12:33 -04:00
committed by Nicholas Tinsley
parent 86cf8200b5
commit 36dface175
6 changed files with 264 additions and 7 deletions

View File

@@ -8,7 +8,6 @@ package org.signal.core.util
import org.signal.core.util.logging.Log
import kotlin.time.Duration.Companion.nanoseconds
import kotlin.time.DurationUnit
import kotlin.time.ExperimentalTime
import kotlin.time.measureTimedValue
/**
@@ -83,7 +82,6 @@ class Stopwatch @JvmOverloads constructor(private val title: String, private val
/**
* Logs how long it takes to perform the operation.
*/
@OptIn(ExperimentalTime::class)
inline fun <T> logTime(tag: String, label: String, decimalPlaces: Int = 0, block: () -> T): T {
val result = measureTimedValue(block)
Log.d(tag, "$label: ${result.duration.toDouble(DurationUnit.MILLISECONDS).roundedString(decimalPlaces)}")