templates5/bf.scala
changeset 231 eecbc9ae73c2
parent 230 bebe34c975a8
child 285 bd9d142d2cd8
--- a/templates5/bf.scala	Thu Dec 06 13:52:50 2018 +0000
+++ b/templates5/bf.scala	Thu Dec 06 15:15:31 2018 +0000
@@ -8,9 +8,9 @@
 
 
 // (1) Write a function that takes a file name as argument and
-// and requests the corresponding file from disk. It returns the
+// and requests the corresponding file from disk. It Returns the
 // content of the file as a String. If the file does not exists,
-// the function should return the empty string.
+// the function should Return the empty string.
 
 import io.Source
 import scala.util._
@@ -186,7 +186,7 @@
   val start = System.nanoTime()
   for (i <- 0 until n) code
   val end = System.nanoTime()
-  (end - start)/1.0e9
+  (end - start)/(n * 1.0e9)
 }
 
 time_needed(1, run(b1))