0

Here is my code:

def computations1(params: AnyRef*): Future[ComputaionResults] ={
    //computations
}

def computations2(params: AnyRef*): Future[ComputaionResults] ={
  //computations
}

for{
    results1 <- computations1()
    results2 <- computations2()
} yield {
    //do with results
}

How much time each computation executed? I need to find the longest computation in production.

rtruszk
  • 3,902
  • 13
  • 36
  • 53
MrRontgen
  • 132
  • 1
  • 6
  • 4
    Based on the information you have given, definitely greater than zero seconds, and probably less than infinity. You should make it more clear as to what you're asking. – Michael Zajac Nov 26 '14 at 14:56
  • 1
    If you need profiling (I suppose you want to see which function lasts longer so you can pick the other one) look at this topic http://stackoverflow.com/questions/9160001/how-to-profile-methods-in-scala or just use google for scala profiling or scala stop watch or similar – Igor Nov 26 '14 at 15:20
  • If you want profiling do as other have suggested. If you are just wondering about the asymptotical time complexity of the two functions, you need to post the code of the functions and the the code of all the relevant sub-functions called (or at least their complexity). Also, you have a typo in the "ComputaionResults" class (missing T) – Diego Martinoia Nov 26 '14 at 16:33
  • If you're asking how to profile Scala in production, look at Takipi. – lmm Nov 26 '14 at 22:40

0 Answers0