By wrapping it in a function as:
function test()
    tic()
    n = 100000000
    x = 0.234
    for i = 1:n
        x = max(x*x, 1.0-x*x)
    end
    println(x)
    print("Done.")    
    toc()
end
test() #jit compilation occurs
test() # timing 0.284217675 s

On my machine the original took 26.96566 s

Reply via email to