def meassureExecutionTime(block: => Unit) = { val start = System.currentTimeMillis(); block val end = System.currentTimeMillis(); end - start; } var sum = 0; val time = meassureExecutionTime { for (i <- 1 to 100000) { sum += i; } } println(sum); println(time);
Thursday, September 27, 2012
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment