UndefVarError: tic not defined

I typed

tic()

in Julia, and got message:

UndefVarError: tic not defined

Am I missing any package here?

1 Like

Did you want to use tic/toc à la Matlab? If so use

start = time()
...
elapsed = time() - start

Or use @time

1 Like

When updating any old code to version 1.0+, it is always beneficial to run your code in version 0.7:

julia> tic()
┌ Warning: `tic()` is deprecated, use `@time`, `@elapsed`, or calls to `time_ns()` instead.
│   caller = top-level scope at none:0
└ @ Core none:0

The deprecation warning gives you the correct alternative(s) for your command.

4 Likes