progs/re2.scala
changeset 343 539b2e88f5b9
parent 261 24531cfaa36a
child 414 065ca01b62ae
equal deleted inserted replaced
342:c235e0aeb8df 343:539b2e88f5b9
    48   for (j <- 1 to i) code
    48   for (j <- 1 to i) code
    49   val end = System.nanoTime()
    49   val end = System.nanoTime()
    50   (end - start)/(i * 1.0e9)
    50   (end - start)/(i * 1.0e9)
    51 }
    51 }
    52 
    52 
    53 for (i <- 1 to 100) {
    53 //for (i <- 1 to 100) {
    54   println(i + ": " + "%.5f".format(time_needed(1, matches(EVIL(i), "a" * i))))
    54 //  println(i + ": " + "%.5f".format(time_needed(1, matches(EVIL(i), "a" * i))))
    55 }
    55 //}
    56 
    56 
    57 //a bit bolder test
    57 //a bit bolder test
    58 for (i <- 1 to 1000 by 50) {
    58 for (i <- 1 to 1000 by 50) {
    59   println(i + " " + "%.5f".format(time_needed(1, matches(EVIL(i), "a" * i))))
    59   println(i + " " + "%.5f".format(time_needed(1, matches(EVIL(i), "a" * i))))
    60 }
    60 }