updated
authorChristian Urban <urbanc@in.tum.de>
Thu, 06 Dec 2018 15:15:31 +0000
changeset 231 eecbc9ae73c2
parent 230 bebe34c975a8
child 232 0855c4478f27
updated
solutions5/benchmark.bf
solutions5/bf.scala
templates5/bf.scala
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/solutions5/benchmark.bf	Thu Dec 06 15:15:31 2018 +0000
@@ -0,0 +1,4 @@
+>++[<+++++++++++++>-]<[[>+>+<<-]>[<+>-]++++++++
+[>++++++++<-]>.[-]<<>++++++++++[>++++++++++[>++
+++++++++[>++++++++++[>++++++++++[>++++++++++[>+
++++++++++[-]<-]<-]<-]<-]<-]<-]<-]++++++++++.
\ No newline at end of file
--- a/solutions5/bf.scala	Thu Dec 06 13:52:50 2018 +0000
+++ b/solutions5/bf.scala	Thu Dec 06 15:15:31 2018 +0000
@@ -216,7 +216,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))
--- 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))