com.jetbrains.pluginverifier.tasks.profiling.PluginVerificationProfilings.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of verifier-cli Show documentation
Show all versions of verifier-cli Show documentation
Command-line interface for JetBrains Plugin Verifier with set of high-level tasks for plugin and IDE validation
package com.jetbrains.pluginverifier.tasks.profiling
import com.jetbrains.pluginverifier.tasks.TaskResult
import java.time.Duration
import java.util.concurrent.atomic.AtomicReference
import kotlin.system.measureTimeMillis
fun measurePluginVerification(measuredBlock: (Unit) -> TaskResult): MeasuredResult {
val result = AtomicReference()
val durationInMillis: Long = measureTimeMillis {
result.set(measuredBlock.invoke(Unit))
}
return MeasuredResult(result.get(), Duration.ofMillis(durationInMillis))
}
data class MeasuredResult(val taskResult: TaskResult, val duration: Duration)