title: How I know the runtime of a code in scala?
body: <p>I need to calculate the runtime of a code in scala. The code is.</p>
  
  <pre><code>val data = sc.textFile("/home/david/Desktop/Datos Entrada/household/household90Parseado.txt")
  
  val parsedData = data.map(s =&gt; Vectors.dense(s.split(' ').map(_.toDouble))).cache()
  
  val numClusters = 5
  val numIterations = 10 
  val clusters = KMeans.train(parsedData, numClusters, numIterations)
  </code></pre>
  
  <p>I need to know the runtime to process this code, the time have to be on seconds.</p>