progs/re2.scala
changeset 415 4ae59fd3b174
parent 414 065ca01b62ae
child 422 5deefcc8cffa
equal deleted inserted replaced
414:065ca01b62ae 415:4ae59fd3b174
    49   for (j <- 1 to i) code
    49   for (j <- 1 to i) code
    50   val end = System.nanoTime()
    50   val end = System.nanoTime()
    51   (end - start)/(i * 1.0e9)
    51   (end - start)/(i * 1.0e9)
    52 }
    52 }
    53 
    53 
    54 //for (i <- 1 to 100) {
    54 for (i <- 1 to 100) {
    55 //  println(i + ": " + "%.5f".format(time_needed(1, matches(EVIL1(i), "a" * i))))
    55   println(i + ": " + "%.5f".format(time_needed(1, matches(EVIL1(i), "a" * i))))
    56 //}
    56 }
    57 
    57 
    58 //a bit bolder test
    58 //a bit bolder test
    59 for (i <- 1 to 1000 by 50) {
    59 for (i <- 1 to 1001 by 50) {
    60   println(i + " " + "%.5f".format(time_needed(1, matches(EVIL1(i), "a" * i))))
    60   println(i + " " + "%.5f".format(time_needed(2, matches(EVIL1(i), "a" * i))))
    61 }
    61 }
    62 
    62 
    63 
    63 
    64 for (i <- 1 to 4002 by 500) {
    64 for (i <- 1 to 4501 by 500) {
    65   println(i + " " + "%.5f".format(time_needed(4, matches(EVIL2, "a" * i))))
    65   println(i + " " + "%.5f".format(time_needed(2, matches(EVIL2, "a" * i))))
    66 }
    66 }
    67 
    67 
    68 
    68