remove clone
This commit is contained in:
parent
bca1b43fa4
commit
bcc7d4de68
@ -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")
|
||||
}
|
Loading…
Reference in New Issue
Block a user