Hello,
Why the result below shows the scala script is even faster than the complied program?
$ scala -Dscala.time Hello nice buddy world
hello nice buddy world
[total 2ms]
$ scala -Dscala.time hello.scala nice buddy world
hello nice buddy world
[total 1ms]
$ scala -Dscala.time Hello nice buddy world
hello nice buddy world
[total 2ms]
$ scala -Dscala.time hello.scala nice buddy world
hello nice buddy world
[total 1ms]
(I have run above comparison twice, the results are the same)
The hello.scala is quite simple:
object Hello extends App {
if (args.length > 0)
println(s"hello ${args.mkString(" ")}")
else
println("hello word")
}
Is “scala -Dscala.time” run differently with the system command “time”?
Thank you.