added try/catch to eliminate overhead for tic and toc in julia