collectAsync

fun collectAsync(callback: (String) -> Unit, timeout: Long = 15000)

Asynchronous method used to collect profiling information and callback function to process the profiling data

Parameters

callback

: (String) -> Unit(Void in Kotlin)

timeInMillis

: Uint32, default 15000(15 seconds), once timeout, callback triggered regardless if profiling is done

Example

func dwnApiCall(_ fp: String) {
print("Got FP String: \(fp)")
}

let sdk = DwnProfilingSDK(config)
sdk.start(config)
val callback : (String) -> Unit = { fp: String -> dwnApiCall(fp) }
sdk.collectAsync(callback)