remove clone

This commit is contained in:
Raffaele Mignone 2020-04-25 18:51:02 +02:00
parent bca1b43fa4
commit bcc7d4de68
Signed by: norangebit
GPG Key ID: F5255658CB220573

View File

@ -1,29 +0,0 @@
package drills.drill08.exercise3
import drills.drill08.exercise2.Finder
import drills.drill08.exercise2.Worker
import util.rmi.Client
import kotlin.time.ExperimentalTime
import kotlin.time.measureTime
@ExperimentalTime
fun main() {
Client(clientHandler).start()
}
@ExperimentalTime
val clientHandler = {
val finder = Client.lookup("finder") as Finder
val workerNumber = 4
val workers = Array(workerNumber) { Worker(finder) }
val elapsed = measureTime {
workers.forEach { it.start() }
workers.forEach { it.join() }
}
println("Total elapsed time: $elapsed")
println("Throughput: ${(workerNumber * Worker.REQUEST_NUMBER) / elapsed.inSeconds} req/s")
}