def computations1(params: AnyRef*): Future[ComputaionResults] ={
//computations
}
def computations2(params: AnyRef*): Future[ComputaionResults] ={
//computations
}
for{
results1 <- computations1()
results2 <- computations2()
} yield {
//do with results
}
def time[R](block: => R): R = {
val t0 = System.nanoTime()
val result = block // call-by-name
val t1 = System.nanoTime()
println("Elapsed time: " + (t1 - t0) + "ns")
result
}
// Now wrap your method calls, for example change this...
val result = 1 to 1000 sum
// ... into this
val result = time { 1 to 1000 sum }