equal
deleted
inserted
replaced
60 |
60 |
61 // the evil regular expression (a*)*b |
61 // the evil regular expression (a*)*b |
62 val EVIL2 = SEQ(STAR(STAR(CHAR('a'))), CHAR('b')) |
62 val EVIL2 = SEQ(STAR(STAR(CHAR('a'))), CHAR('b')) |
63 |
63 |
64 //for measuring time |
64 //for measuring time |
65 def time_needed[T](i: Int, code: => T) = { |
65 def time_needed[T](i: Int, code => T) = { |
66 val start = System.nanoTime() |
66 val start = System.nanoTime() |
67 for (j <- 1 to i) code |
67 for (j <- 1 to i) code() |
68 val end = System.nanoTime() |
68 val end = System.nanoTime() |
69 (end - start)/(i * 1.0e9) |
69 (end - start)/(i * 1.0e9) |
70 } |
70 } |
71 |
71 |
72 //test: (a?{n}) (a{n}) |
72 //test: (a?{n}) (a{n}) |