|
Scala
1.4.0.3 |
|||
Benchmark
can be used to quickly turn an existing
class into a benchmark. Here is a short example:
object sort1 extends Sorter with Benchmark { def run = sort(List.range(1, 1000)); }The run method has to be defined by the user, who will perform the timed operation there. Run the benchmark as follows:
scala sort1 5 times.logThis will run the benchmark 5 times and log the execution times in a file called times.log
Method Summary | |
def main(args: Array[String]): Unit
The entry point. |
|
abstract
|
def run: Unit
this method should be implemented by the concrete benchmark |
def runBenchmark(noTimes: Int): List[Long]
Run the benchmark the specified number of times and return a list with the execution times in milliseconds in reverse order of the execution |
Methods inherited from java/lang/Object-class |
clone, eq, equals, finalize, getClass, hashCode, ne, notify, notifyAll, synchronized, toString, wait, wait, wait |
Methods inherited from scala/Any-class |
!=, ==, asInstanceOf, isInstanceOf, match |
Methods inherited from scala/ScalaObject-class |
getScalaType |
Method Detail |
abstract def run: Unit
def runBenchmark(noTimes: Int): List[Long]
def main(args: Array[String]): Unit
|
Scala
1.4.0.3 |
|||