I'm using java ReactiveX (RxJava) in scala Play Framework 2.5 to communicate with couchbase asynchronously I would like to know how long it took for my observable to run? I define my observable using the code below.
def get(id: String) : Observable[Profile] = {
this.bucket
.async()
// can I have a start time here possibly using map?
.get(id)
.map[Profile](toProfile)
// can I have an end time here possibly using map?
}
I call it using the following
Thread.sleep(1000)
val observable = get("myID")
Thread.sleep(1000)
// measure start time here
println("observable: " + observable.toBlocking.first())
// measure end time here
Thread.sleep(1000)
How can I measure how long it took for the observable to run?
Thanking you in advance
Francis