diff options
author | Philipp Haller <hallerp@gmail.com> | 2009-12-04 17:16:04 +0000 |
---|---|---|
committer | Philipp Haller <hallerp@gmail.com> | 2009-12-04 17:16:04 +0000 |
commit | 8be82e14993fb05559193cf9514debda0bbfd7f9 (patch) | |
tree | 89c3fa5d48eacc5bc21eaa4a998716a48a9ed7d4 /test/files/jvm/t2515.scala | |
parent | 36b1d9cf1c03de5e6a7ce82b73088697590dbcd9 (diff) | |
download | scala-8be82e14993fb05559193cf9514debda0bbfd7f9.tar.gz scala-8be82e14993fb05559193cf9514debda0bbfd7f9.tar.bz2 scala-8be82e14993fb05559193cf9514debda0bbfd7f9.zip |
Made test jvm/t2515 more robust.
Diffstat (limited to 'test/files/jvm/t2515.scala')
-rw-r--r-- | test/files/jvm/t2515.scala | 33 |
1 files changed, 18 insertions, 15 deletions
diff --git a/test/files/jvm/t2515.scala b/test/files/jvm/t2515.scala index 83cb058168..ee655967f3 100644 --- a/test/files/jvm/t2515.scala +++ b/test/files/jvm/t2515.scala @@ -18,23 +18,26 @@ object Test { } def main(args:Array[String]) : Unit = { - val format = new java.text.DecimalFormat("000.00'ms'") - var iter = 1 - val done = 11 - while (iter < done) { - val start = System.nanoTime() - val result = compute() - val time = System.nanoTime() - start - result match { - case Some(result) => - //printf("Iteration %2d succeeded after %s %n", iter, format.format(time / 1e6)) - printf("Iteration %2d succeeded%n", iter) - iter += 1 - case None => - printf(">>>> Iteration %2d failed after %s <<<<< %n", iter, format.format(time / 1e6)) - iter = done + val ft = Futures.future { + val format = new java.text.DecimalFormat("000.00'ms'") + var iter = 1 + val done = 11 + while (iter < done) { + val start = System.nanoTime() + val result = compute() + val time = System.nanoTime() - start + result match { + case Some(result) => + //printf("Iteration %2d succeeded after %s %n", iter, format.format(time / 1e6)) + printf("Iteration %2d succeeded%n", iter) + iter += 1 + case None => + printf(">>>> Iteration %2d failed after %s <<<<< %n", iter, format.format(time / 1e6)) + iter = done + } } } + ft() } } |