mockwebserver / okhttp3.mockwebserver / MockResponse / throttleBody

throttleBody

fun throttleBody(bytesPerPeriod: Long, period: Long, unit: TimeUnit): MockResponse

Throttles the request reader and response writer to sleep for the given period after each series of bytesPerPeriod bytes are transferred. Use this to simulate network behavior.