Now, from the write(6,*), I can see clearly how much time it took between t0 and t1, t2 and t3.
In Julia is there a similar way so that I can do things similar above?
Like, I know, in Julia one can do
But is there a command such that I can store the time it took in the above block?
Because if I were to do timing for different blocks in the code, I need to store the time it took for each of the block. Finally, I can print those time altogether.
Thanks in advance! Apologize for the stupid question.
Read carefully the docstring to understand some caveats. Other related macros, @timev, @timed, @elapsed, and @allocated, may be useful, depending on what you really need. @elapsed may be closer to what you asked:
julia> t = @elapsed sleep(0.5)
However for more fine-grained benchmarking you should look into BenchmarkTools.jl. For profiling, instead, see the message above.