November 2016
Intermediate to advanced
697 pages
14h 44m
English
To get the basic time information, you can use the time() function that returns, for example, 1.408719961424e9, the number of seconds since a predefined date called the epoch (normally, the 1st of January 1970 on Unix system), This is useful for measuring the time interval between two events, for example, to benchmark how long a long calculation takes:
start_time = time()
# long computation
time_elapsed = time() - start_time
println("Time elapsed: $time_elapsed")Most useful function is strftime(time()) that returns a string in "22/08/2014 17:06:13" format.
If you want more functionality greater than equal to 0.3 when working in Julia, take a look at the Dates package. Add this to the environment with Pkg.add("Dates") (it provides ...
Read now
Unlock full access